Sending and Getting JMS Messages
A process can send JMS messages and get JMS messages from a queue in a loop.
Procedure
Result
The Console displays messages similar to the following:
16:08:26.242 [PVM:In-Memory STWorkProcessor:1] INFO c.t.b.p.g.L.t.b.p.j.G.Log - Message=Sending 5 Queue Messages
16:08:26.292 [PVM:In-Memory STWorkProcessor:1] INFO c.t.b.p.g.L.t.b.p.j.G.Log1 - Message=Finished sending 5 Queue messages. Getting 5 Queue messages...
16:08:26.303 [PVM:In-Memory STWorkProcessor:3] INFO c.t.b.p.g.L.t.b.p.j.G.Log2 - Message=Received message number 1. Message = This is message number 1
16:08:26.307 [PVM:In-Memory STWorkProcessor:5] INFO c.t.b.p.g.L.t.b.p.j.G.Log2 - Message=Received message number 2. Message = This is message number 2
16:08:26.311 [PVM:In-Memory STWorkProcessor:1] INFO c.t.b.p.g.L.t.b.p.j.G.Log2 - Message=Received message number 3. Message = This is message number 3
16:08:26.315 [PVM:In-Memory STWorkProcessor:3] INFO c.t.b.p.g.L.t.b.p.j.G.Log2 - Message=Received message number 4. Message = This is message number 4
16:08:26.318 [PVM:In-Memory STWorkProcessor:5] INFO c.t.b.p.g.L.t.b.p.j.G.Log2 - Message=Received message number 5. Message = This is message number 5
The GetQueueMessage.log output file at C:\tmp\GetQueueMessage shows the following information of sending five Queue messages, and getting five messages.
Sending 5 Queue Messages
Finished sending 5 Queue messages. Getting 5 Queue messages...
Received message number 1. Message = This is message number 1
Received message number 2. Message = This is message number 2
Received message number 3. Message = This is message number 3
Received message number 4. Message = This is message number 4
Received message number 5. Message = This is message number 5
Understanding the Configuration
The JMS Send Message activity sends the messages with the message style set to Queue.
The Get JMS Queue Message activity receives the JMS messages from a Queue in a loop. The activity is placed in a group and the group action is set to Repeat.
The condition loops five times and receives five messages.