From the course: Learning Java Enterprise Edition

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

JMS in practice: Senders and receivers

JMS in practice: Senders and receivers - Java EE Tutorial

From the course: Learning Java Enterprise Edition

Start my 1-month free trial

JMS in practice: Senders and receivers

- [Instructor] Okay, so now let's have a look and see how this is implemented in our application. First thing we need to do is to have a look at our sender. I happen to know that this is called JmsApplicationEvents. Having a look at this class, you can see that this is an application scope class. Scrolling down, we can see here that we're getting a reference to the Jms context. We use this to set up our queues and send messages. And also we're getting a reference to the name of our destination. Here we can see that the destination is called cargoHandledQueue. So when a cargo event is fired into the system, the Cargo was handled method is called. And so let's have a look at this method and what's going on. So this method receives a cargo event. And this happens whenever we enter something into our mobile app. Looking here at the Jms context, we can see that we create ourselves a producer. We set various properties. Here we're setting a low priority when disabling our message ID, and…

Contents