You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by DraCzech <dr...@gmail.com> on 2016/12/08 14:11:46 UTC

JmsConnector.doConnectorInit() suppresses exceptions

*Configuration:* Hi, I'm using ActiveMQ 5.14.1 to connect from a device
(running linux derivate OS) to Azure IoT Hub. With Qpid JMS client 0.11.1
providing AMQPS based JmsConnection implementation. I'm using Destination
bridges to connect my local queues to remote queues. And connection state is
handled by a state machine in my code according to network state, number of
messages held by destination or in response to exception.

*Description:* The device connects to local wireless network which
unfortunately dropps all communication on port 5671.
initializeForeignConnection() method in SimpleJmsQueueConnector always ends
with a timeout exception as no handshake is possible. This exception is
logged and caught in JmsConnector's doConnectorInit() method. Then
scheduleAsyncForeignConnectionReconnect() is called, Exception is
suppressed, doConnectorInit() returns true, init() method returns true etc.
My part of code doesn't see any problem, but it still cannot connect
properly.

*Possible solution:* If you don't want the doConnectorInit() in JmsConnector
to throw an exception (which would be OK in such case) it could at least
return false in case an Exception is caught in it. Result of the init() is
also never checked, but it could help as well. The best thing would be to
set maximal number of connection attempts and once
scheduleAsyncForeignConnectionReconnect() is called too many times, it
should throw an exception.

*Notes:* My understanding of the problem might be a bit naive and there
might be a counter example disproving my proposal of solution.



--
View this message in context: http://activemq.2283324.n4.nabble.com/JmsConnector-doConnectorInit-suppresses-exceptions-tp4719962.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.