You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by abhijith <to...@gmail.com> on 2016/03/19 01:32:53 UTC

Artemis Connection retry during initial connection

Hi,

I am trying to test initial connection factory retry attempts if connection
is unsuccessful.  To try this I purposefully did not enable SSL where as my
server is setup for TLS communication.

Please find below my code 

 ActiveMQConnectionFactory cf =
ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF, server1,
server2);
        cf.setRetryInterval(1000);
        cf.setReconnectAttempts(3);
        cf.setRetryIntervalMultiplier(1.0);

When I run connection factory keeps on trying to connect even after 3
attempts. I am not sure why this keeps trying.  Is there any other flag I am
missing here?  I was also looking at some documentation or example on
initial retry attempts.  Any help is greatly appreciated.  Thanks


15:46:09.200 [Thread-10 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Started Netty Connector version
4.0.32.Final
15:46:09.200 [Thread-10 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Remote destination:
artemis01-dev.myserver.com:61616
15:46:09.306 [Thread-10 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Reconnection successful
15:46:09.495 [Thread-11 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Trying reconnection attempt 0/5
15:46:09.496 [Thread-11 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Trying to connect with connector =
org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@701b206f,
parameters = {port=61616, host=artemis01-dev.myserver.com} connector = null
15:46:09.496 [Thread-11 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Started Netty Connector version
4.0.32.Final
15:46:09.496 [Thread-11 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Remote destination:
artemis01-dev.myserver.com:61616
15:46:09.602 [Thread-11 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Reconnection successful
15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Trying reconnection attempt 0/5
15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Trying to connect with connector =
org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@701b206f,
parameters = {port=61616, host=artemis01-dev.myserver.com} connector = null
15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Started Netty Connector version
4.0.32.Final
15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Remote destination:
artemis01-dev.myserver.com:61616
15:46:09.893 [Thread-12 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Reconnection successful
15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Trying reconnection attempt 0/5
15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Trying to connect with connector =
org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@701b206f,
parameters = {port=61616, host=artemis01-dev.myserver.com} connector = null
15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Started Netty Connector version
4.0.32.Final
15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)] DEBUG
o.a.activemq.artemis.core.client - Remote destination:
artemis01-dev.myserver.com:61616





--
View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Connection-retry-during-initial-connection-tp4709695.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Artemis Connection retry during initial connection

Posted by abhijith <to...@gmail.com>.
Thanks.  It did not really work and I think it is because connection itself
is successful but it cannot go any further because of SSL.  I think it is
bug and will see if I can file report with example.

I got around it by setting call timeout.  Below settings stops trying to
connect after 1 second regardless of attempts.

connectionfactory.setCallTimeout(1000);

Thanks
Abhi



--
View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Connection-retry-during-initial-connection-tp4709695p4709935.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Artemis Connection retry during initial connection

Posted by andytaylor <an...@gmail.com>.
try cf.setInitialConnectAttempts(3)


On 19/03/16 00:32, abhijith [via ActiveMQ] wrote:
> Hi,
>
> I am trying to test initial connection factory retry attempts if
> connection is unsuccessful.  To try this I purposefully did not enable
> SSL where as my server is setup for TLS communication.
>
> Please find below my code
>
>   ActiveMQConnectionFactory cf =
> ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.CF,
> server1, server2);
>          cf.setRetryInterval(1000);
>          cf.setReconnectAttempts(3);
>          cf.setRetryIntervalMultiplier(1.0);
>
> When I run connection factory keeps on trying to connect even after 3
> attempts. I am not sure why this keeps trying.  Is there any other flag
> I am missing here?  I was also looking at some documentation or example
> on initial retry attempts.  Any help is greatly appreciated.  Thanks
>
>
> 15:46:09.200 [Thread-10 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Started Netty Connector version
> 4.0.32.Final
> 15:46:09.200 [Thread-10 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Remote destination:
> artemis01-dev.myserver.com:61616
> 15:46:09.306 [Thread-10 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Reconnection successful
> 15:46:09.495 [Thread-11 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Trying reconnection attempt 0/5
> 15:46:09.496 [Thread-11 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Trying to connect with
> connector =
> org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@701b206f,
> parameters = {port=61616, host=artemis01-dev.myserver.com} connector = null
> 15:46:09.496 [Thread-11 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Started Netty Connector version
> 4.0.32.Final
> 15:46:09.496 [Thread-11 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Remote destination:
> artemis01-dev.myserver.com:61616
> 15:46:09.602 [Thread-11 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Reconnection successful
> 15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Trying reconnection attempt 0/5
> 15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Trying to connect with
> connector =
> org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@701b206f,
> parameters = {port=61616, host=artemis01-dev.myserver.com} connector = null
> 15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Started Netty Connector version
> 4.0.32.Final
> 15:46:09.796 [Thread-12 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Remote destination:
> artemis01-dev.myserver.com:61616
> 15:46:09.893 [Thread-12 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Reconnection successful
> 15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Trying reconnection attempt 0/5
> 15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Trying to connect with
> connector =
> org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory@701b206f,
> parameters = {port=61616, host=artemis01-dev.myserver.com} connector = null
> 15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Started Netty Connector version
> 4.0.32.Final
> 15:46:10.084 [Thread-13 (ActiveMQ-client-global-threads-1238683479)]
> DEBUG o.a.activemq.artemis.core.client - Remote destination:
> artemis01-dev.myserver.com:61616
>
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://activemq.2283324.n4.nabble.com/Artemis-Connection-retry-during-initial-connection-tp4709695.html
>
> To start a new topic under ActiveMQ - User, email
> ml-node+s2283324n2341805h35@n4.nabble.com
> To unsubscribe from ActiveMQ - User, click here
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2341805&code=YW5keS50YXlsczY3QGdtYWlsLmNvbXwyMzQxODA1fC05MDE1NDk1MzM=>.
> NAML
> <http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>





--
View this message in context: http://activemq.2283324.n4.nabble.com/Artemis-Connection-retry-during-initial-connection-tp4709695p4709768.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.