Wildfly 10 for jms messaging - spring

I tried a simple spring jms example and deployed in tomee worked fine (din't start activemq server). Then I migrated to wildfly 10. But here i need to start activemq server. Is it needed wildfly is already integrated with activemq right? On starting the server (standalone.bat) should start the activemq isn't?
EDIT: Actually some configuration has been changed (I was not aware of the change). I unzipped wildfly 10 again and tried to deploy using "standalone.bat -c standalone-full.xml". Server started successfully but got the below given error.
10:29:26,172 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 13367ms - Started 401 of 691 services (397 services are lazy, passive or on-demand)
10:29:29,101 INFO [org.springframework.jms.listener.DefaultMessageListenerContainer] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) JMS message listener invoker needs to establish shared Connection
10:29:30,111 ERROR [org.springframework.jms.listener.DefaultMessageListenerContainer] (org.springframework.jms.listener.DefaultMessageListenerContainer#0-1) Could not refresh JMS Connection for destination 'myMessageQueue' - retrying in 5000 ms. Cause: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: connect

I managed to fix this problem by adding an embedded broker to my springcontext.xml
<amq:broker id="broker" useJmx="false" persistent="false">
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:61617" />
</amq:transportConnectors>
</amq:broker>
Refered : http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html

Related

Connection Refused for Consul

I am starting a Spring Boot Application with Consul.
I am getting the following error
2019-08-30 12:34:22.650 ERROR 23428 --- [ main] o.s.boot.SpringApplication : Application run failed
com.ecwid.consul.transport.TransportException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8090 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect`
I changed the default port in bootstrap.properties file.
I also used another non-Consul Spring Boot Application and it worked fine for that use-case with same port.
8090 is not the default port for Consul. You didn't say if your other successful app was on the same host or not, but make sure Consul is actually listening on that port with netstat or ss.
By default, Consul listens for API requests on port 8500.

javax.naming.NameNotFoundException for migrating from IBM Mq to tomcat

I am receiving below exception while trying to connect JMS MQ using tomcat. We are migrating from WebSphere to Tomcat.So currently I am using IBM MQ jars
2018-11-21 12:26:53,862 DEBUG com.mbfs.slr.bo.pe.JMSClient.sendMsg:283 - Exception occured : null
2018-11-21 12:26:53,863 DEBUG com.mbfs.slr.bo.pe.JMSClient.receiveMessage:384 - Trying to receive message ...
2018-11-21 12:26:53,863 DEBUG com.mbfs.slr.bo.pe.JMSClient.receiveMessage:385 - getJndiConnectionFactory : jms/Name of Queue
2018-11-21 12:26:53,863 DEBUG com.mbfs.slr.bo.pe.JMSClient.receiveMessage:386 - getRecieveJndiQueueName : jms/name of receiving queue
2018-11-21 12:26:53,864 DEBUG com.mbfs.slr.bo.pe.JMSClient.createQueue:221 - Created JNDI intial Context ...
2018-11-21 12:26:53,864 DEBUG com.mbfs.slr.bo.pe.JMSClient.createQueue:239 - JNDI API lookup failed: javax.naming.NameNotFoundException: Name [jms/NAmeofQueue] is not bound in this Context. Unable to find [jms].
I have placed all IBM MQ jars.I have placed entry in TomEE server.xml and web.xml.
Please let me know if I am missing any configuration
I have placed following entry in
Server.xml
<Resource name="jms/XXXBQueueConnectionFactory" auth="Container" type="com.ibm.mq.jms.MQQueueConnectionFactory" factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory" description="JMS Queue Connection Factory" HOST="XXXX" PORT="XX5" CHAN="XXX" TRAN="1" QMGR="XXX" />

Apache Camel with RabbitMQ - 2.22.1 version connection issue

When i upgrade my camel version from 2.14 to 2.22.1 and try to connect to RabbitMQ, i get an connection error
.to("rabbitmq:exchangeName?addresses=${addresses}&exchangeType=topic&autoDelete=false&durable=true&username=${rabbitUserName}&password=${rabbitPassWord}&vhost=${vinHost}&queue=***")
I get an connection refused error to rabbitMQ
[AMQP Connection 127.0.0.1:5672] ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occured

JMS ActiveMQ SpringBoot .FailoverTransport

iam trying to connected to remote broker url in activeMQ (activemq installed in unix vm)
iam able to connect from browser from my laptop.
while running springboot iam getting this error
--- [ActiveMQ Task-1] o.a.a.t.failover.FailoverTransport : Failed to connect to [tcp://http://199.247.18.11:61616] after: 8 attempt(s) continuing to retry.
what could be the issue?
Please remove https:// from your connection string. Port 61616 is expecting JMS connections.
Your connection string should be tcp://199.247.18.11:61616 or something similar. There is a rest API that (I think) goes through the built in HTTP server but it's not going to listen on 61616 and it's going to have a much longer URL. Something like
http://admin:admin#localhost:8161/api/message?destination=queue://myqueue
still issue
yml file
activemq:
broker-url: failover:(tcp://http://199.247.18.11:61616)?initialReconnectDelay=1000&maxReconnectDelay=60000&warnAfterReconnectAttempts=2
error:
2018-05-01 07:41:51.312 WARN 6560 --- [ActiveMQ Task-1] o.a.a.t.failover.FailoverTransport : Failed to connect to [tcp://http://199.247.18.11:61616] after: 2 attempt(s) continuing to retry.

SocketException Broken pipe receives when the server is under load (Spring AMQP)

We are using Spring AMQP 2.8 with RabbitMQ 2.8.7 version. We are building our connection factory as below.
<!-- RabbitMQ Local connectivity -->
<rabbit:connection-factory
id="localWhispirConnectionFactory"
addresses="${system.local.rabbitmq.host}"
username="${system.local.rabbitmq.username}"
password="${system.local.rabbitmq.password}"
connection-factory="rabbitWhispirLocalFactory"/>
<!-- Heartbeat configuration every 10sec -->
<bean id="rabbitWhispirLocalFactory" class="com.rabbitmq.client.ConnectionFactory">
<property name="requestedHeartbeat" value="10" />
</bean>
But when the server is under load, we received the below exceptions. Tries several ways, but appreciate any comments to overcome this issue.
2015-04-20 12:01:00,174 INFO [SimpleMessageListenerContainer] Restarting Consumer: tag=[amq.ctag-wfazQuIuS-BM-CosxP_2GJ], channel=Cached Rabbit Channel: AMQChannel(amqp://whispir#10.50.50.128:5672/,62), acknowledgeMode=AUTO local queue size=0
2015-04-20 12:01:00,156 WARN [SimpleMessageListenerContainer] Consumer raised exception, processing can restart if the connection factory supports it. Exception summary: java.net.SocketException: Broken pipe
2015-04-20 12:01:00,174 INFO [SimpleMessageListenerContainer] Restarting Consumer: tag=[amq.ctag-AjjxOJ2doe4yi2GtTHKumM], channel=Cached Rabbit Channel: AMQChannel(amqp://whispir#10.50.50.128:5672/,29), acknowledgeMode=AUTO local queue size=0
Thanks.
There is no such version (2.8) of Spring AMQP. Currently, the latest version is 1.4.4.
Check the server logs to see if there are any clues there.
That said, 2.8.7 is a very old broker; I am quite sure the rabbitmq guys would recommend upgrading to a more recent version, currently the latest is 3.5.1.

Resources