<address-settings>
<address-setting match="galileo.#">
<dead-letter-address>galileo.endpoint.DLQ</dead-letter-address>
<max-delivery-attempts>3</max-delivery-attempts>
</address-setting>
</address-settings>
<addresses>
<address name="galileo.endpoint.DLQ">
<anycast>
<queue name="galileo.endpoint.DLQ" />
</anycast>
</address>
<address name="galileo.endpoint">
<anycast>
<queue name="galileo.endpoint" />
</anycast>
</address>
</addresses>
- Outbound socket connection
<outbound-socket-binding name="remote-artemis"> <remote-destination host="localhost" port="61616"/> </outbound-socket-binding>
- Remote connector
<remote-connector name="remote-artemis" socket-binding="remote-artemis"> </remote-connector>
- Connection Factory
<pooled-connection-factory name="remote-artemis" transaction="xa" ha="true" entries="java:/JmsRemoteXA java:/jms/remoteCF" connectors="remote-artemis"/>
- Use jndi for artemis queue.
<subsystem xmlns="urn:jboss:domain:naming:2.0"> <bindings> <external-context name="java:global/remoteContext" module="org.apache.activemq.artemis" class="javax.naming.InitialContext"> <environment> <property name="java.naming.factory.initial" value="org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory"/> <property name="java.naming.provider.url" value="tcp://localhost:61616"/> <property name="queue.testQueue" value="galileo.endpoint"/> </environment> </external-context> <lookup name="java:/testQueue" lookup="java:global/remoteContext/testQueue"/> </bindings> <remote-naming/> </subsystem>
-
Build application with command:
mvn clean install
-
Deploy to local eap instance with command:
mvn wildfly:deploy
-
Open the browser to test the rest endpoint
- /producer to send a message
- /pairs to read all message
- /pairs/{key}/delete to delete a msg per key
- /pairs/delete to delete all msg
-
Simulate rollback scenario
Uncomment the following line (54) on PairConsumer.java
pairService.setWithRollback(new Pair(message.getJMSMessageID(), textMessage.getText()));