public class JmsMatsMessageBrokerSpecifics
extends java.lang.Object
ActiveMQConnection.is[Closed|Closing|TransportFailed]
.MatsEndpoint.MatsRefuseMessageException
(i.e. insta-DLQing), by setting redelivery attempts to 0 on the
MessageConsumer when rolling back Session: ActiveMQSession.setRedeliveryPolicy(zeroAttemptsPolicy)
.Modifier and Type | Method and Description |
---|---|
static void |
init() |
static void |
instaDlqWithRollbackLambda(javax.jms.MessageConsumer jmsMessageConsumer,
io.mats3.impl.jms.JmsMatsMessageBrokerSpecifics.JmsMatsJmsExceptionThrowingRunnable rollbackLambda)
If the MessageConsumer is an ActiveMQMessageConsumer, then it should set it into "0 redeliveries" mode, and then
run the provided lambda to rollback the current message, and then re-set the deliveries.
|
static void |
isConnectionLive(javax.jms.Connection jmsConnection)
For an ActiveMQ JMS Connection, this method throws
JmsMatsException.JmsMatsJmsException if any of the following methods
return true :
jmsConnection.isClosing()
jmsConnection.isClosed()
jmsConnection.isTransportFailed()
|
public static void init()
public static void isConnectionLive(javax.jms.Connection jmsConnection) throws JmsMatsException.JmsMatsJmsException
JmsMatsException.JmsMatsJmsException
if any of the following methods
return true
:
jmsConnection
- the JMS Connection to check.JmsMatsException.JmsMatsJmsException
- if it seems like this Connection is dead.public static void instaDlqWithRollbackLambda(javax.jms.MessageConsumer jmsMessageConsumer, io.mats3.impl.jms.JmsMatsMessageBrokerSpecifics.JmsMatsJmsExceptionThrowingRunnable rollbackLambda) throws JmsMatsException.JmsMatsJmsException
jmsMessageConsumer
- consumer to set to "0 redeliveries" (will be reset before return)rollbackLambda
- the lambda that should be run to perform the rollback of the current message.JmsMatsException.JmsMatsJmsException