The JMS API is a messaging standard that allows Java EE applications and components to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous.
GlassFish Server support for JMS messaging, in general, and for message-driven beans in particular, requires a JMS provider. GlassFish Server uses the Message Queue software as its native JMS provider, providing transparent JMS messaging support. This support is known within GlassFish Server as the JMS Service. JMS requires only minimal administration. When a JMS client accesses a JMS administered object for the first time, the client JVM retrieves the JMS configuration from GlassFish Server.
A JMS resource is a type of connector. Message Queue is integrated with GlassFish Server by means of a connector module, also known as a resource adapter, which is defined by the Java EE Connector Architecture Specification 1.6. Any Java EE components that are deployed to GlassFish Server exchange JMS messages by using the JMS provider that is integrated by the connector module. When a JMS resource is created in GlassFish Server, a connector resource is created in the background. Each JMS operation invokes the connector runtime and uses the Message Queue connector module in the background. GlassFish Server pools JMS connections automatically.
You can configure properties to be used by all JMS connections. If you update these properties at runtime, only those connection factories that are created after the properties are updated will apply the updated values. The existing connection factories will continue to have the original property values. For most values to take effect, GlassFish Server must be restarted. For instructions, see To Restart a Domain. The only property that can be updated without restarting GlassFish Server is the default JMS host.
LOCAL Mode. GlassFish Server starts and stops the Message Queue broker that is specified as the default JMS host. The Message Queue process is started in a separate virtual machine from the GlassFish Server process. GlassFish Server supplies an additional port to the broker, which is used by the broker to start the RMI registry. This port number will be equal to the configured JMS port for that instance, plus 100. For example, if the JMS port number is 37676, then this additional port number is 37776.
In LOCAL mode, use the Start Arguments attribute to specify Message Queue broker startup parameters.
REMOTE Mode. When the type attribute is set to REMOTE, the Message Queue broker must be started and stopped separately from GlassFish Server. Message Queue tools must be used to configure and tune the broker. In this situation, GlassFish Server uses an externally–configured broker or broker cluster. REMOTE type is most suitable for clusters.
In REMOTE mode, you must specify Message Queue broker startup parameters using Message Queue tools. The Start Arguments attribute is ignored.
EMBEDDED Mode (default). When the JMS type attribute is set to EMBEDDED, GlassFish Server and the JMS broker are colocated in the same virtual machine. The JMS Service is started in-process and managed by GlassFish Server.
In EMBEDDED mode, the JMS operations bypass the networking stack, which leads to performance optimization.
For information about administering Message Queue, see Oracle GlassFish Message Queue 4.4.2 Administration Guide.