Re: Failover Transport - send timeout not working

2019-03-31 Thread Arthur Naseef
Unfortunately, you can't have it both ways with the failover transport as
it cannot know what the application wants.

That is -- either the failover transport tries forever (my preferred
approach), or it fails and stops trying to reconnect after some time.

If you are looking to have individual message sends fail after timeout when
the broker is unreachable for an extended period of time, perhaps the
following strategy could work for you:

   - Set a TTL on the message that matches the send timeout (probably with
   a little extra time added so a message doesn't expire immediately after
   being sent in the worst-case-scenario)
   - Add a TransportListener to the ActiveMQConnectionFactory to log, and
   take any necessary action, when the transport disconnects from the broker
   - Use an in-memory queue with a separate thread that's dedicated to
   performing the JMS send to ActiveMQ, using futures (or similar
   synchronization) to notify the original thread when the timeout or success
   send occurs

Alternatively, you can use the failover transport with timeout and add
reconnect logic to your application.  This seems counter-intuitive to me
since that's the failover transport's main job in life.

Hope this helps.

Art


On Thu, Mar 28, 2019 at 3:34 AM tal.cohen2  wrote:

> but i want that when the broker will be available again he will try to
> reconnect (as failover suppose to work)
>
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html
>


Re: Failover Transport - send timeout not working

2019-03-28 Thread tal.cohen2
but i want that when the broker will be available again he will try to
reconnect (as failover suppose to work)




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html


Re: Failover Transport - send timeout not working

2019-03-27 Thread Gary Tully
note the last comment on AMQ-.
Check the logs, your failover connection is probably trying to
reconnect forever. use maxReconnectAttempts=x to limit that.

On Mon, 25 Mar 2019 at 12:43, tal.cohen2  wrote:
>
> Hi .
> we are using activemq v.5.15.8 broker and client. (jdk 1.8)
> when configuring broker jms url in the client side  , this way :
> 
> 
> 
> 
>  value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
>  value=failover://(tcp://${ACTIVEMQ_HOSTNAME}:61616?daemon=true)?b>timeout=6"/*>
>
>
> after the service is running and connected to the activemq , we shut down
> activemq broker and try to send message. on v.5.8 the operation timeout
> after the defined time . on this version it never timeout even with this
> paramter .
> someone can give us a soultion ?
>
>
>
> Best Regards,
> Tal
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html