0
votes

I am using JMS with ActiveMQ. I have the ActiveMQ broker running on one server and it creates a queue and a message consumer that it uses to receive messages from other servers. If another server tries to send a message to the queue and it fails for some reason (like if the network between the servers goes down), then I do not want that server to retry sending the message. Just send it once and if it fails don't retry. Is this possible with ActiveMQ/JMS? The javax.jms.Session class has 3 acknowledgment modes (AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE), all of which suggest that the JMS message producer will retry on a failure.

1

1 Answers

2
votes

If your client is not using the failover transport then a failure of the connection while attempting to send means that the client won't attempt to reconnect and thereby not try to resend the message once the connection is back up.

If you use the failover transport and the client experiences a network failure while sending the transport will attempt to reconnect and the client will block on the send until a connection is re-established and the message will be sent to the broker again.