Understanding JMS Queues and JMS Topics

Java Message Service (JMS) is quite simply a standard in which people typically follow to exchange messages between one another. There's a few interfaces that's available within the J2EE platform that allows you to follow the particular standard. If done right, you can set these JMS interfaces that provides a JMS client (definition of a 'JMS client' below) the ability to create, send, receive, and read the messages.
March 12, 2015
JMSAQ

The Simple understanding

Java Message Service (JMS) is quite simply a standard in which people typically follow to exchange messages between one another. There's a few interfaces that's available within the J2EE platform that allows you to follow the particular standard. If done right, you can set these JMS interfaces that provides a JMS client (definition of a 'JMS client' below) the ability to create, send, receive, and read the messages.

There's many JMS 'components' that you'll need to consider, but keep in mind not all not every JMS component is required (it really depends what type of AQ you're attempting to do.

To kick this off, I have summarize the JMS components:


Summary of the JMS components

https://technicalconfessions.com/images/postimages/postimages/_374_4_understanding JMS definitions between queues and topics for Oracle AQ.png

  • JMS provider <-- Provides the access to the JMS interfaces
  • JMS client <-- Can be considered as the application that creates the message. It can be considered as the application that receives the message also, so be careful with the ambiguity
  • JMS producer/publisher <-- Who ever creates and sends the message
  • JMS consumer/subscriber <-- Receives the JMS message
  • JMS message <-- The actual message being transferred. It contains the header and a payload
  • JMS queue <-- Once the message has been delivered, this is where the message will reside until a JMS consumer/subscriber 'consumes' the message
  • JMS topic <-- Used for publishing the message to multiple subscribers
  • JMS queue table <-- Basically where all the messages sit when published by the producer

Once you've got a basic level of understanding, you then need to determine the scenarios to determine what components are required. For instance, if a publisher sends a message to the queue, how many users will consume the message? More than 1 aka multiple consumers? If so, you must have subscribers. If the queue only has one JMS consumer, then you dont need a JMS subscriber.

In fact, if there are multiple consumers, you need a JMS topic. For a single consumer (aka point-to-point), you need a JMS queue.


JMS QUEUE

As mentioned, a JMS queue is only a point to point model meaning there's a guarantee delivery of the message between two clients. This is because the consumer 'pulls' the message, instead of the message being sent automatically in the hope that the consumer is alive Because it's only a one-to-one relationship between the JMS producer and the JMS consumer, you can get the JMS consumer to give the 'thumbs-up' acknowledgement to the JMS queue once received. Furthermore, the consumer can view the message first and then decide whether or not to accept the message


JMS TOPIC

On contrast, a a JMS Topic typically has Multiple clients and subscribe to the message. Unlike the JMS Queue, there's not guarantee that the message is delivered


So, what next?

So now you have a basic understanding of JMS Queues and Topics, let's now jump to the JMS messages blog.

The next blog HOW TO: Enqueue a JMS_TEXT_MESSAGE from java to Oracle database Queue also elaborates particular components of a JMS message as well as understanding the syntax of a JMS TEXT MESSAGE

About the author

Daniel is a Technical Manager with over 10 years of consulting expertise in the Identity and Access Management space.
Daniel has built from scratch this blog as well as technicalconfessions.com
Follow Daniel on twitter @nervouswiggles

Comments

Other Posts

AWS-PHP integration - Email not sent. SMTP Error: Could not authenticate.

phpsmtpaws

February 6, 2020
Created by: Daniel Redfern
AS I was migrating my environment into an S3 environment, I wanted to leverage off the SES services that AWS provide, more specifically, to leverage the off the SMTP functionality by sending an email via PHP
Read More...

SOLUTION: no headers files (.h) found in softwareserial - Arduino

Arduino

February 24, 2019
Created by: Daniel Redfern
The WeMos D1 is a ESP8266 WiFi based board is an extension to the current out-of-the-box library that comes with the Arduino installation. Because of this, you need to import in the libraries as well as acknowledging the specific board. This process is highly confusion with a number of different individuals talking about a number of different ways to integrate.
Read More...

NameID element must be present as part of the Subject in the Response message

ShibbolethSAML

August 7, 2018
Created by: Daniel Redfern
NameID element must be present as part of the Subject in the Response message, please enable it in the IDP configuration.
Read More...

HOW TO provision AD group membership from OpenIDM

OpenIDMICFAD-connector

June 15, 2018
Created by: Daniel Redfern
For what I see, there's not too many supportive documentations out there that will demonstrate how provision AD group membership with the ICF connector using OpenIDM. The use of the special ldapGroups attribute is not explained anywhere in the Integrators guides to to the date of this blog. This quick blog identifies the tasks required to provision AD group membership from OpenIDM to AD using the LDAP ICF connector. However this doesn't really explain what ldapGroups actually does and there's no real worked example of how to go from an Assignment to ldapGroups to an assigned group in AD. I wrote up a wiki article for my own reference: AD group memberships automatically to users This is just my view, others may disagree, but I think the implementation experience could be improved with some more documentation and a more detailed example here.
Read More...

ForgeRock OpenIDM - InvalidCredentialException: Remote framework key is invalid

ICFIDMOpenIDMOpenICF

November 8, 2017
Created by: Daniel Redfern
In the past, the similar error occurred though for the Oracle Identity Management solution. invalidcredentialexception remote framework key is invalid Because they all share the ICF connector framework, the error/solution would be the same.
Read More...

org.forgerock.script.exception.ScriptCompilationException: missing ; before statement

IDMsync.confforgerockopenidm

November 8, 2017
Created by: Daniel Redfern
org.forgerock.script.exception.ScriptCompilationException: missing ; before statement
Read More...

ForgeRock IDM - org.forgerock.script.exception.ScriptCompilationException: missing ; before statemen

OpenIDMsync.confForgeRock

September 17, 2017
Created by: Daniel Redfern
ForgeRock IDM - org.forgerock.script.exception.ScriptCompilationException: missing ; before statement
Read More...

Caused by: org.forgerock.json.resource.BadRequestException: Target does not support attribute groups

OpenIDMForgeRockICFConnector

September 17, 2017
Created by: Daniel Redfern
When performing the attempt of a reconciliation from ForgeRock IDM to Active Directory, I would get the following error
Read More...

ForgeRock OpenIDM - InvalidCredentialException: Remote framework key is invalid

OpenIDMForgeRockICFConnectorAD

September 17, 2017
Created by: Daniel Redfern
In the past, the similar error occurred though for the Oracle Identity Management solution. invalidcredentialexception remote framework key is invalid Because they all share the ICF connector framework, the error/solution would be the same.
Read More...

ERROR Caused by com.google.api.client.auth.oauth2.TokenResponseException 400 Bad Request - invalid_g

OpenIDMIDMGoogleGoogle-AppsICFreconciliation

September 12, 2017
Created by: Daniel Redfern
During the reconcilation from OpenIDM to the ICF google apps connector, the following error response would occur. ERROR Caused by com.google.api.client.auth.oauth2.TokenResponseException 400 Bad Request - invalid_grant
Read More...