In this post I will show how to configure JMS in the Weblogic Server (WLS).
This is not an area with lack of information as there is plenty of information out there. However, it is fairly new to me, as I haven’t used it yet 🙂
I have extended experience with TIBCO’s JMS implementation, called Enterprise Messaging Service (EMS), and even tough lately Kafka eclipses JMS in the tech spotlight, the reality is that there are plenty of JMS architectures out there.
Streaming, in my opinion, is not a full replacement to JMS traditional architectures – I see it more as a variation/complement, which allows the choice (always good to have options) over which one better fulfils the requirements at hand.
My WLS environment is a single node (admin+server1) running on OCI. This was created via the Marketplace – check the How to Provision Weblogic in 15 minutes post!
Creating a JMS Server
“JMS servers are environment-related configuration entities that act as management containers for destination resources…. A JMS server’s primary responsibility for its targeted destinations is to maintain information on what persistent store is used for any persistent messages that arrive on the destinations, and to maintain the states of durable subscribers created on the destinations. …” – from here.
In your WLS Console go to: Services>Messaging>JMS Servers>New
- Name: The name of the JMS server.
- Persistent Store: Create a new one -> A JMS store can be file-based or database.
Choose the Target (Server) on which to deploy the JMS server.
Creating a JMS Module
Before creating JMS resources such as queues, topics and connection factories, one needs to first create a JMS Module, which acts as a container for these resources.
Go to: Services>Messaging>JMS Modules>New
Choose the desired target – Server or Cluster.
You have the option to start adding resources (queues/topics/connection factory etc..) immediately after.
Creating JMS Connection factories
“A ConnectionFactory
encapsulates connection configuration information, and enables JMS applications to create a Connection. A connection factory supports concurrent use, enabling multiple threads to access the object simultaneously. You can use the preconfigured default connection factories provided by WebLogic JMS, or you can configure one or more connection factories to create connections with predefined attributes that suit your application.” – from here.
Name – ConnectionFactoryJMSDT
JNDI Name – jms/connectionFactory
Everything else I leave as default
Creating JMS Destinations
A destination can be either:
- Queue (p2p)
- Topic (pub/sub).
I will create a simple queue (same process for a topic)
Give it a Name and a JNDI Name.
Select a subdeployment (create a new one).
“A subdeployment is a mechanism by which JMS module resources (such as queues, topics, and connection factories) are grouped and targeted to a server resource (such as JMS servers, server instances, SAF agents, or a cluster).“
Finally, choose the target JMS Server.
And this is the final result with the connection factory and the queue definitions!
Conclusion
In conclusion, that is all there is to it. This is the fast track, as there are endless properties and options along the way that are worthwhile exploring.
It gives any organisation the necessary tools to configure an enterprise grade messaging framework.
In the next post I will cover the Java Producer!