The message service, provided in Java EE by the Java Message Service (JMS) API, is one of the most important and versatile features provided by Java EE environments.
It uses the Producer-Consumer approach, where one peer (the Producer) puts a message into a queue and another peer (the Consumer) reads the message from there.
Both the Producer and Consumer can be different applications, even using different technologies.
This recipe will show you how to build a messaging service using GlassFish 5. Each Java EE server has its own way to set up the service, so if are using some other implementations, you should take a look at its documentation.
On the other hand, the Java EE code generated here will work on any Java EE 8-compatible implementation. Standard for the win!