[ 
https://issues.apache.org/jira/browse/AMQ-6156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134306#comment-15134306
 ] 

Ger Lawlor commented on AMQ-6156:
---------------------------------

Hi Timothy,

I've started making changes in respect of your comments above to my AMQ 
producer client to improve the failover transport handling.
In doing so I have added the following query parameters onto the failover URL

failover:(tcp://localhost:61616?startupMaxReconnectAttempts=10&timeout=1000,tcp://localhost:61616?startupMaxReconnectAttempts=10&timeout=1000)?maxReconnectAttempts=5&maxReconnectDelay=30000&randomize=false

I am now getting an error where the connection fails due to incorrect connect 
parameters {startupMaxReconnectAttempts=10, timeout=1000}
If you would prefer I open a new case for this issue then let me know, but I am 
wondering if you've seen this before and have any ideas as to what is wrong - 
all parameters being passed are listed as transport parameters on the failover 
transport page: http://activemq.apache.org/failover-transport-reference.html

Thanks,
Ger.


> ActiveMQConnection threads in parked state during startup
> ---------------------------------------------------------
>
>                 Key: AMQ-6156
>                 URL: https://issues.apache.org/jira/browse/AMQ-6156
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.11.1
>         Environment: Linux
>            Reporter: Ger Lawlor
>
> I've implemented a JMS producer using 
> org.apache.activemq.ActiveMQConnectionFactory API. In the deployment they are 
> 10 threads launched and each thread invokes the following sequence of methods 
> which wrap around the ActiveMQConnection API.
> connector = new ActiveMQConnect();
> connector.setEndPointURL(primaryURL, secondaryURL, connectorQueryString);
> connector.setCredentials(userName, password);
> connector.initializeConnection();
> connector.setDestinationQueue(queueName);
> connector.addMessageToQueue(message);
> connector.sendMessageToQueue();
> The call to initializeConnection in turn invokes the following code which 
> returns the connection 
> 1) ActiveMQConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory(m_userName, m_password, m_endPointUrl);
> 2) m_queueConnection = connectionFactory.createConnection();
> 3) m_queueConnection.start();
> However, (and potentially under load), a large % of the threads enter the 
> parked state and stay there. The stack trace for these threads is as follows:
> java.lang.Thread.State: WAITING 
>         at sun.misc.Unsafe.park(Native Method) 
>         at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118) 
>         at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1841)
>  
>         at 
> java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:341) 
>         at 
> org.apache.activemq.transport.FutureResponse.getResult(FutureResponse.java:40)
>  
>         at 
> org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:80)
>  
>         at 
> org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1195)
>  
>         at 
> org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1289)
>  
>         at 
> org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:456) 
>         at ActiveMQConnect.initializeConnection(ActiveMQConnect.java:63) 
> The JMS producer connects using failover transport to an active/passive or 
> primary/failover configuration.
> Is the problem being caused by the failover URL? The documentation seemed to 
> indicate that the failover URL can be sent with format:
> failover:(tcp://amq01:61616,tcp://amq02:61616)?queryString....
> Would appreciate any advice so I can resolve this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to