I've been using ActiveMQ for a few weeks now and every time I boot up my laptop, I always just use activemq start to start it but today it throws an error:
Failed to start Apache ActiveMQ, java.io.IOException: Transport Connector could not be registered in
JMX: Failed to bind to server socket: tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: java.net.BindException: Address already in use: JVM_Bind)
What can I do to resolve this?
There is already another ActiveMQ instance running so the new one cannot bind to that server socket just as the exception tells you. Kill the previous instance and then you can start a new one.
Related
I'm using the following endpoint :
jms:queue:MY_JMS_QUEUE?transacted=true&recoveryInterval=10000&testConnectionOnStartup=true
Everything works well but whenever the MQ connection is lost (due to IBM MQ server restart), the connection refresh does not work.
In my logs i have that :
ERROR [c.c.j.DefaultJmsMessageListenerContainer] []] Could not refresh JMS Connection for destination 'MY_JMS_QUEUE' - retrying using FixedBackOff{interval=10000, currentAttempts=0, maxAttempts=unlimited}. Cause: JMSWMQ0018: Failed to connect to queue manager 'xxx' with connection mode 'Client' ......('MQRC_Q_MGR_NOT_AVAILABLE')
And nothing else, i was expecting to have the same error messages multiples times with currentAttempts=1 then 2... until the MQ is back.
I checked the documentation but i don't see anything else. My configuration:
Camel version : 3.11.3
Java: 11.0.8
Spring boot : 2.5.2
As your connection mode is "Client" you can give the MQ automatic JMS client reconnection feature a try. You would need to configure the "ClientReconnectOptions" in the connection factory definition.
I would like to use ActiveMQ in my Spring Boot application. During debugging I have found out following error:
org.apache.activemq.broker.BrokerService : Failed to start Apache ActiveMQ (localhost, null)javax.management.InstanceAlreadyExistsException: org.apache.activemq:type=Broker,brokerName=localhost`
Seems like broker is created upon creation of the first connection, according to ActiveMQ's documentation. Is is possible to turn off auto-creation by setting the create property on the VM Transport to false, e.g.:
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?create=false");
When I tried this solution I got following error:
DefaultJmsMessageListenerContainer : Could not refresh JMS Connection for destination 'test' - retrying using FixedBackOff{interval=5000, currentAttempts=364, maxAttempts=unlimited}. Cause: Could not create Transport. Reason: java.io.IOException: Broker named 'localhost' does not exist.
Now I think the broker is not creating at all or this process is pending. Did anyone have a similar issue? If so how did you resolve it?
ActiveMQ's vm transport optionally creates a broker, or connects to a running broker.
Sounds like you are missing a step in your application boot-up plan. Either you need:
A component to startup the broker
Designate one of the connection factories to start the broker using the vm transport:
Designated broker startup connection factory:
vm://localhost?create=true
All other connection factories:
vm://localhost?create=false
We have an IBM WebSphere AS 9.0.0.7 and when we want to deploy an application containing an MDB - which listens to a remote WebShpere MQ server - while the MQ server is down, then WAS reports an error
Caused by: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internalerror caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.
and stops the deployment, i.e. application does not start. Which is a big problem as it is a critical hub for other operations. We want to force WAS to start the application and retry the JMS connection later. Is it possible?
You can try setting custom property WAS_EndpointInitialState property to INACTIVE, see here and here, and also may want to look through here.
We've found a solution here: Configuring properties for the IBM MQ resource adapter
Trick was to set startupRetryCount and startupRetryInterval. When the MQ server is not available, the app starts, however it is reported as "Partial start". All other parts of the application seems to be running just fine.
Using springframework 4.3.6, I have configured AMQP (RabbitMQ) to retry connection to the message broker every 5 seconds for 5 times. When all attempts fail to make a connection to the broker, spring fails with a warning:
WARN [x.x.x.x.SimpleMessageListenerContainer] stopping container - restart recovery attempts exhausted
I would like to listen to the listener container stop event and notify systems team about unavailability of the message bus.
I tried creating ApplicationListener with type ListenerContainerConsumerFailedEvent and also DeclarationExceptionEvent. But none of it worked. So i was wondering if there is any other way to catch container stopped event in case of failure to start the container successfully.
If it helps, the error message i get after each attempt to connect is
ERROR [x.x.x.x.SimpleMessageListenerContainer] Failed to check/redeclare auto-delete queue(s).
I am trying to setup IBM MQ 7.5.0.2 + Glassfish 4(Payara) JDK 8 and using Camel Integration as a Client
I have followed deploying RAR approach however I am unable to make a connection from Glassfish to MQ
The Connection Pool ping fails stating "Ping Connection Pool failed for MyPool. MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 Please check the server.log for more details."
In server logs, I see the below:
[#|2017-03-24T08:40:31.494+1100|WARNING|Payara 4.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.resource.allocator|_ThreadID=111;_ThreadName=org.springframework.jms.listener.DefaultMessageListenerContainer#0-1;_TimeMillis=1490305231494;_LevelValue=900;|RAR5038:Unexpected exception while creating resource for pool MyPool. Exception : com.ibm.mq.connector.DetailedResourceException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.|#]
RAR5117 : Failed to obtain/create connection from connection pool [ MyPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011|#]
I am following the below:
https://genericjmsra.java.net/docs/websphere-mq-integration-guide/webspheremq_integration_guide.html
I faced a similar problem, the issue in my case was that the channel was blocked by the CHLAUTH rule. I fixed the issue by disabling authorisation on the channel using the below commands on the IBM Integration Console:
alter QMGR CHLAUTH(DISABLED) alter AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(none) REFRESH SECURITY TYPE(CONNAUTH)