Package io.mats3.test
Class MatsTestBrokerInterface.MatsTestBrokerInterface_JmsMatsFactory
java.lang.Object
io.mats3.test.MatsTestBrokerInterface.MatsTestBrokerInterface_JmsMatsFactory
- All Implemented Interfaces:
MatsTestBrokerInterface
- Enclosing interface:
- MatsTestBrokerInterface
public static class MatsTestBrokerInterface.MatsTestBrokerInterface_JmsMatsFactory
extends Object
implements MatsTestBrokerInterface
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.mats3.test.MatsTestBrokerInterface
MatsTestBrokerInterface.MatsMessageRepresentation, MatsTestBrokerInterface.MatsTestBrokerInterface_JmsMatsFactory
-
Method Summary
Modifier and TypeMethodDescription_latePopulate
(javax.jms.ConnectionFactory connectionFactory, MatsFactory matsFactory) This method is most probably not for you!.protected void
getDlqMessage
(String endpointOrStageId) Waits a couple of seconds for a message to appear on the Dead Letter Queue for the provided endpoint- or stageId (Queue name "DLQ."+matsendpointPrefix+endpointOrStageId) - and also checks the standard common ActiveMQ DLQ (Queue name "ActiveMQ.DLQ") in case the broker is not configured with specific DLQs per Queue, which is relevant if you fire up an unmodified ActiveMQ distribution on the command line, check theMatsTestBroker
class JavaDoc for how to use an external MQ instead of the in-VM which otherwise is fired up.
-
Method Details
-
_latePopulate
public MatsTestBrokerInterface.MatsTestBrokerInterface_JmsMatsFactory _latePopulate(javax.jms.ConnectionFactory connectionFactory, MatsFactory matsFactory) Description copied from interface:MatsTestBrokerInterface
This method is most probably not for you!. It is employed bySpringJmsMatsFactoryWrapper
, by reflection invocation when it is both on classpath and as an instance in the Spring context, to perform "late setting" of the properties which the tool needs to perform its job. (Reason for reflection: This class resides in the 'mats-test' project - which is for testing, while theSpringJmsMatsFactoryWrapper
is in the 'mats-spring-jms' project - which is for "production"). The matsFactory parameter currently needs to be a JmsMatsFactory. We need all of the following from itmatsFactory.getFactoryConfig().getMatsDestinationPrefix()
(standard MatsFactory)matsFactory.getFactoryConfig().getMatsTraceKey()
(standard MatsFactory)- The Mats Interceptor API (from
MatsInterceptable
, which JmsMatsFactory is) - The
MatsSerializer
to provide access to contents from messages (from JmsMatsFactory)
MatsFactory.MatsFactoryWrapper
, but it must resolve to aJmsMatsFactory
via theMatsFactory.unwrapFully()
! Otherwise, it'll throw anIllegalArgumentException
.- Specified by:
_latePopulate
in interfaceMatsTestBrokerInterface
- Returns:
this
-
checkCorrectSetup
protected void checkCorrectSetup() -
getDlqMessage
Waits a couple of seconds for a message to appear on the Dead Letter Queue for the provided endpoint- or stageId (Queue name "DLQ."+matsendpointPrefix+endpointOrStageId) - and also checks the standard common ActiveMQ DLQ (Queue name "ActiveMQ.DLQ") in case the broker is not configured with specific DLQs per Queue, which is relevant if you fire up an unmodified ActiveMQ distribution on the command line, check theMatsTestBroker
class JavaDoc for how to use an external MQ instead of the in-VM which otherwise is fired up. (NOTE: It is HIGHLY suggested to use the "specific DLQ" pattern in any production setting, as this is much easier to reason about when ugly things starts hitting fans).- Specified by:
getDlqMessage
in interfaceMatsTestBrokerInterface
- Parameters:
endpointOrStageId
- the endpoint which is expected to generate a DLQ message.- Returns:
- the
MatsTrace
of the DLQ'ed message.
-