This article shows you step-by-step how to set-up xDM 5.3 Data Notification based on CustomerB2CDemo to an JMS Target. Our xDM 5.3 is running on Windows and we will be using ActiveMQ as the JMS queue.
- Install Active MQ
2. Unzip it to your C: drive say C:\apache-activemq-5.16.2
3. Configure System Environment Variable JAVA_HOME
4. Start Active MQ in command prompt
activemq start
5. Go to ActiveMQ Console http://127.0.0.1:8161/admin/, go to Queues, create a queue named “xdmtest”
6. Open another Command Prompt, start the ActiveMQ as a consumer
activemq consumer --destination queue://xdmtest
7. If you check the ActiveMQ Console, you’ll see that the “Number of Consumers” becomes 1
8. You can click “Send To”, try to send a sample message to the JMS
9. After you click send, check your ActiveMQ consumer command prompt, you should see the message is received
And the message count has increased in the ActiveMQ Console
10. Copy the JMS Libraries to the Tomcat\lib folder
C:\apache-activemq-5.16.2\lib\activemq-broker-5.16.0.jar
C:\apache-activemq-5.16.2\lib\activemq-client-5.16.0.jar
C:\apache-activemq-5.16.2\lib\geronimo-jms_1.1_spec-1.1.1.jar
C:\apache-activemq-5.16.2\lib\geronimo-j2ee-management_1.1_spec-1.0.1.jar
C:\apache-activemq-5.16.2\lib\hawtbuf-1.11.jar
C:\apache-activemq-5.16.2\lib\slf4j-api-1.7.30.jar
C:\apache-activemq-5.16.2\lib\optional\log4j-1.2.17.jar,
C:\apache-activemq-5.16.2\lib\optional\slf4j-log4j12-1.7.30.jar
11. Re-start your xDM's Tomcat
12. Create a Named Queries called “Person”, make sure it has the Query Parameters and Filter as below:
Filter : BatchID > :QUERY_PARAM_PREVIOU_BATCH AND BatchID <= :QUERY_PARAM_CURRENT_BATCH
13. Create a Data Notification named “ChangePersonActiveMQ” with the following properties
Property Name and Property Value java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory java.naming.provider.url = failover://tcp://localhost:61616
14. Activate the Data Notification
15. Create a new Person in CustomerB2CDemo via UI or via REST API, you should see the Person appears in the ActiveMQ consumer command prompt session, it is working!