Distributed destination (i.e. queue or topic) is a set of destinations, however that can be used as a single and a logical destination for the clients (i.e. producer and consumer). In this post we would be concentrating on the steps to create a Uniform Distributed Queue (UDQ). Following are some information about UDQ. For demo of UDQ you can check this post JMS Demo using WebLogic Uniform Distributed Queue (UDQ).
Description:
When we configure a UDQ we do not have to create any physical queue on the JMS servers instead WebLogic Server takes care of it and uniformly creates logical UDQ’s on the JMS servers. This way WLS ensures that all the parameters such as persistence, paging and quotas are across a cluster.
Advantages of UDQ
- High availability.
- Load balancing
Steps are as follows:
- Start your WebLogic Server an Login to the Admin Console.
- Create a JMS Server and File store
Repeat the same image steps to create JMS Server-2
- Configuring JMS Module
- Creating Connection Factory
- Creating Sub-Deployment
- Creating (UDQ) Uniform Distributed Queue
Best Practices
SCENARIO-1
(1-AS, 2-MS, 2-Boxes)
Box-A
=====
MS-1 under Cluster
JMSServer-1 and Store-1 => MS-1*
Box-B
======
MS-2 under Cluster
JMSServer-2 and Store-2 => MS-2*
Admin Server
==========
JMS_Module => Cluster
SubDeployment_UDQ => JMS Server-1, JMS Server-2
ConnFacty (with “affinity disabled”) => Cluster
UDQ => SubDeployment_UDQ
SCENARIO-2
(1-AS, 2-MS, 1-Box)
Box-A
=====
Admin Server
MS-1, MS-2 under Cluster
JMSServer-1 and Store-1 => MS-1*
JMSServer-2 and Store-2 => MS-2*
JMS_Module => Cluster
SubDeployment_UDQ => JMSServer-1, JMSServer-2
ConnFacty (with “affinity disabled”) => Cluster
UDQ => SubDeployment_UDQ
Note:
- Admin Server can be on any one of the boxes in scenario-1
- (=>) means targeted to
- (*) means migratable target [i.e. JMSServer-1 and Store-1 are targeted to “MS-1 (migratable)”]
- In Box-A and Box-B the Cluster, SubDeployment_UDQ, ConnFacty and UDQ are the same, NOT different in scenario-1
Few things to remember:
- We would need at least minimum 2 managed servers.
- Both these managed servers should be in a cluster.
- JMS servers and their respective store (i.e. File-store or JDBC-store) should be targeted on same server.
- JMS Module should be targeted on the cluster.
.
.
Thanks,
Ravish Mody
December 18th, 2010 on 4:45 am
HI Ravish,
A couple of querries
1.what is the significance of subdeployment?and what do u mean by affinity disabled
i had a scenario in which i created a jms server and corresponding jms module on two managed servers but targetted all the CF and queues to the same subdeployment
3.tried creating without Subdeployment but the weblogic server wasnt allowing me to do that ,therefore i creted it
but need to understand what subdeployment does fubnctionally..?
December 18th, 2010 on 12:47 pm
Hi Ritu,
Welcome to Middleware Magic.
Sub-deployment is used becuase it helps to group up the targetable system modules resources to specific server which are under the scope of system modules.
However if you would try to target the UDQ to the default trageting then you would notice that if you go the the console path (UDQ -> Configuration [tab] -> Members [sub-tab]) no members are seen, but if you use a sub-deployment which is targated to a two JMS servers then you can see both the JMS servers in the members tab.
This way we come to know our configuration is correct and it is the recommanded by the Oracle.
Secondly normal queue and topic can be only trageted to a JMS server however connection factory, UDQ, UDT, Foreign server or SAF can be trageted to more then one servers.
Below link would give you more idea on it
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms_admin/basic_config.html#wp1175007
When Server Affinity is not disabled then many times the proper load balacning does not occuer as it always try to send the messages to the consumer which it perviously had sent thus the load is on the same server more. Hence you have to disable it to make sure that all the messages are load balacne properly on all the servers.
Would suggest you to try and test it and see the difference so that you can get the hang on it 😉
Hope that would answere you questions.
Regards,
Ravish Mody
October 13th, 2011 on 6:24 am
I am new to this site and don’t know how you would know someone left a comment. So I have posted a similar question on the JMS Demo using WebLogic Uniform Distributed Queue (UDQ) but just in case you read this thread to increase my chance of catching you. Apologies.
Hey Ravish,
Thanks for your post – it really helped me understand a lot of things about UDQs however I have few questions.
This is how my setup looks like:
Physical Servers: 2 (call SrvrA, SrvrB)
Admin Server (Server SrvrB)
MS1 (SrvrA) MachineA
MS2 (SrvrB) MachineB
Cluster AB (MS1 and MS2)
I setup as you indicated:
MS1_JMS on MS1 using JDBC store – table prefix MS1_JMS_
MS2_JMS on MS2 using JDBC store – table prefix MS2_JMS_
JMS Module – xyzJmsModule – Cluster – all servers in cluster
Cnx Factory – xyzUDQ_CF – Cluster – all servers in cluster
SubDeployments – xyzSubUDQ – MS1_JMS and MS2_JMS
Distributed Q – xyzUDQ – Allocate Members Uniformly, RRobin – xyzSubUDQ
I am producing the messages using SpringFramework and consuming using MDB. Both the producer and consumers are the same application. The application is deployed on both MS1 and MS2. We are using WebLogic Integration 9.2.2 MP2.
So here are my questions:
1) How can I check the messages are being sent to both MS1 and MS2?
2) If MS1 goes down, will MS2 process messages that were stored in the MS1’s JDBC store (MS1_JMS_WLstore)? Are the messages being written to both MS1_JMS and MS2_JMS JDBC store when received? This also brings me to the question – do the tables need to be different for each JMS server?
3) Given that the JMS servers are on the same servers as the application, I don’t set the URL for performance. How can I check which server processed the message?
4) If you were wondering why we are using the JMS to send data to the same application then here is my explanation. We want to asynchronously process certain logic for which the original creator does not need to wait on. This improves the original creator’s process response time as the extra work – not critical to flow – is not done synchronously. Also if the backend to which the extra work dealt with was done, the original process is not impacted. I hope that makes sense. Any comments to this idea?
I guess that’s enough questions for now. I hope you or anyone else can provide input on this.
Thanks.
October 13th, 2011 on 11:39 pm
Hi Stupify,
Refer to the comment – http://middlewaremagic.com/weblogic/?p=3759#comment-5234
Regards,
Ravish Mody
December 1st, 2011 on 12:24 am
Hi,
Some more questions have popped up from maintenance perspective. Again keep in mind this is Weblogic Integration 9.2 MP2 using JMS provided with 2 Uniform Distributed Queues on a cluster of 2 Managed Servers.
1) Is there a way to control number of messages in the queue? If the limit is reached, log the message and discard it instead of adding to the queue.
2) Is it worth to compact a simple object containing 5 string variables, each no more than 200 characters?
3) If in case there is a backlog built up, say due to dependent backend system was not available and the consumption was paused, how to ensure that not too many messages are consumed/processed (no concern for producing) when the consumption is resumed? Sort of like throttling the consumption. Any suggestions on how to deal with Backlogs would be good to know as well.
4) If the application will be producing about 100 messages per minute and that the processing (consumption) should not take more than 2 seconds, with 16 MDBs in pool configured, is there anything that I need to check/set properly?
5) Monitoring – is it possible to monitor Weblogic server remotely using WLST? Example Weblogic server on 10.10.10.35 and I want to monitor from my desktop. What are the requirements to set this up?
6) Is it possible to monitor from an internal application (java)? How?
December 2nd, 2011 on 11:06 pm
Hi Stupify,
Following are the answers of your questions
1) Is there a way to control number of messages in the queue? If the limit is reached, log the message and discard it instead of adding to the queue.
Yes, you can use messaging quota which is given by Weblogic. With quota you can set the maximum number of messages and then create an logging events to write the log when it has reached a level of the messages is been set. More information in the below links
Topic: Defining Quota
http://docs.oracle.com/cd/E12840_01/wls/docs103/perform/jmstuning.html#wp1146857
Topic: Configuration Options
http://docs.oracle.com/cd/E12840_01/wls/docs103/ConsoleHelp/pagehelp/JMSjmsserverjmsserverconfigthresholdstitle.html
2) Is it worth to compact a simple object containing 5 string variables, each no more than 200 characters?
I dont think there is any hard and fast rule for this, it totally depends on your requirement and environmen.
3) If in case there is a backlog built up, say due to dependent backend system was not available and the consumption was paused, how to ensure that not too many messages are consumed/processed (no concern for producing) when the consumption is resumed? Sort of like throttling the consumption. Any suggestions on how to deal with Backlogs would be good to know as well.
You can try using an error queue to get the control over the messages which are in the queue and how to send them again to the consumer. More information can be found in the below given article.
Steps to Configure Error Queue on Weblogic Server
4) If the application will be producing about 100 messages per minute and that the processing (consumption) should not take more than 2 seconds, with 16 MDBs in pool configured, is there anything that I need to check/set properly?
I believe that there is a bug which has been filed with Oracle regarding something like say if you are sending 17 messages and the first message is taking say about 60 secs to process and other 16 messages are taking just 2 secs to process then the messages from 2-16 would get consumed by the consumer in every 2 secs. But the 17th messages would be only consumed when the 1st messages get consumed that is after 60 seconds even though 17th messages had to take 2 seconds. This is happening because by default its 16 MDBs the 17th messages get stuck behind the first messages, and this issue has been reported Oracle team however they are under-process if this is really a bug or not. The bug number is Bug 13436706 – JMS MESSAGE DELIVERED TO BUSY INSTANCE OF CONSUMER.
5) Monitoring – is it possible to monitor Weblogic server remotely using WLST? Example Weblogic server on 10.10.10.35 and I want to monitor from my desktop. What are the requirements to set this up?
You can try using the WLST scripts given below
Sending Email Alert for JMS Using WLST
WebLogic JMS Monitoring Using WLST
6) Is it possible to monitor from an internal application (java)? How?
You can try using the JMSX code given in the below article
JMS Monitoring using JMX
Regards,
Ravish Mody
December 2nd, 2011 on 9:45 pm
Anyone?
December 3rd, 2011 on 4:45 am
Hi Ravish,
Thanks for your reply. I was able to get #5 and #6 figured out and even put that with the internal application code to call the WLST script instead using:
WLSTInterpreter and InteractiveInterpreter, and using something like this:
private static void monitor(){
InputStream is = ClassLoader.getSystemResourceAsStream(“test.py”);
interpreter.execfile(is);
StringBuffer buffer = new StringBuffer();
buffer.append(“consoleCall=’This is calling script after the fact. ‘n”);
buffer.append(“consoleCall=consoleCall + contentStrn” );
buffer.append(“print ‘\n\n\n’ + consoleCalln”);
log.debug(buffer.toString());
interpreter.exec(buffer.toString());
}
NOTE: contentStr was something I used to get the information in the test.py file.
For #1 – we are using Weblogic 9.2 MP2 and I do not see option to set the MessagesMaximum. Also note that we are using UDQueues, not UDTopics. So this is still something I would like to know.
For #2 – Going to opt not to compress – although would like to convert the object to XMLMessage or TextMessage so that it is easier to see the content and hopefully if needs be deal with the message accordingly.
For #3 – I thought about doing something similar too but we may end up going with application throttled processing as we also need to make sure that the backend systems do not get overloaded when we start processing messages. Any suggestions on throttling?
For #4 – thanks for the information – although i don’t see the transactions we want to do are not time performance sensitive from consumption point of view, just production.
Once I do get a good amount of stuff done I will share my findings to help others in similar situations. For now more information gathering and dealing with issues.
Any suggestions on throttling (consumptions per minute or second) appreciated.
December 5th, 2011 on 10:41 pm
Hi Stupify,
For #1 Below are the links for WLS 9.2 which also goes for any MPx for the same version, little bit of searching would had helped you to find the same links
Topic: Defining Quota
http://docs.oracle.com/cd/E13222_01/wls/docs92/perform/jmstuning.html#wp1146857
Topic: Configuration Options
http://docs.oracle.com/cd/E13222_01/wls/docs92/ConsoleHelp/pagehelp/JMSjmsserverjmsserverconfigthresholdstitle.html
For #2 sounds fine to me.
For #3 To be frank I do not understand why are you looking out for throttling the messages when your consumer comes up. This means your consumer is not fast enough to consume the messages and cant take the load of them. Which is a bad for the environment and not a good practice, due to which you can get few issues in future. You are trying to make the process slower instead of concentrating to make it faster by making your consumer capable of taking the load. In my suggestion I would had concentrated on tuning up the consumer.
For #4 OK
Regards,
Ravish Mody
December 5th, 2011 on 8:17 pm
Anything guys – this is a bit urgent.
December 6th, 2011 on 2:45 am
Ravish,
For #1 I did have a look at it and felt that it wasn’t able to do what I wanted. Anyhow I will review it again and see if I missed something.
For #3 – SLA – Our system relies on couple of backend systems which are sensitive to the load and so have to ensure that we do not exceed their capacity by too much or what the current level is, else risk causing business interruption for key transactions. These messages transactions are not key to the business, just good to have – hence need to ensure we throttle.
August 28th, 2012 on 4:56 pm
Hi Ravish,
Do we have some configuration at weblogic end to delete the temp queue once its work get completed?
We dont want to implement it on code level.
Please guide me if we can implement it at weblogic end.
Thanks,
Ravi Shankar Kumar.
September 12th, 2012 on 6:13 am
Hi Ravish
In our current environment setup, we need to create a Topic[Resource in JMS module] with specific name and jndi name. But I need to target this Topic to 2 clusters. I tried using Uniform distributed topic as well. It gives following error when I try to target to multiple clusters – “A UDD must be targeted to servers within a single cluster or a single stand-alone server, rather than Cluster Cluster1 and Cluster Cluster2 ”
Can you suggest any solution for this.
Thanks for your help.
Shruthi
October 5th, 2012 on 9:10 pm
Hi Ravish,
We are trying to configure JMS in clustered environment in weblogic 10.3.5.0 (Toplink JMS). We are able to succeed configuration using above post and able to see all binded JNDI as well. But when application starts, we are seeing exception mentioned below and we are not able to see any messages log in JMS server.
Please let me know if any additional details required on the same.
———————————————–
Exception [TOPLINK-15013] (OracleAS TopLink – 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.SynchronizationException
Exception Description: Could not find JMS Service Topic named: jms/TopLinkCacheSynchTopic
Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jms.TopLinkCacheSynchTopic’. Resolved ‘jms’; remaining name ‘TopLinkCacheSynchTopic’Local Exception Stack:
Exception [TOPLINK-15013] (OracleAS TopLink – 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.SynchronizationException
Exception Description: Could not find JMS Service Topic named: jms/TopLinkCacheSynchTopic
Internal Exception: javax.naming.NameNotFoundException: Unable to resolve ‘jms.TopLinkCacheSynchTopic’. Resolved ‘jms’; remaining name ‘TopLinkCacheSynchTopic’
at oracle.toplink.exceptions.SynchronizationException.errorLookingUpJMSService(SynchronizationException.java:174)
at oracle.toplink.remote.jms.JMSClusteringService.retreiveRemoteSessions(JMSClusteringService.java:200)
at oracle.toplink.remote.jms.JMSClusteringService.run(JMSClusteringService.java:175)
November 29th, 2012 on 1:06 pm
Hi Magic team,
I’m trying to deal with a strange issue with JMS queue client and need you help to identify the solution.
Server setup:
We are using Weblogic 11g (10.3.3) in a cluster mode (4 nodes) running on AIX 6.1 OS. We have setup 4 JMS servers using admin console and that is targetted each individual node in the cluster. A JMS module has been setup at the domain level and contains 4 destinations targetted to each JMS server ..and hence each individual node.
In the application, we have a JMS queue client which looks up the JNDI connection factory / queue in its own node (default i.e. blank InitialContext is used).
When a message needs to be pushed to a named queue, the JMS Queue client looks-up its local (own) Naming server to obtain the ConnectionFactory and Queue using JNDI names.
Problem:
All though at most times the above described works fine, intermittently, the JMS queue client is unable to obtain the JMS queue in its host node and as per the logs it is attempting to push the message on a JMS queue on a different node. This is a strange behaviour because during look-up for JMS Queue, the InitialContext is blank and there is no way the Queue client could know the existence of the other nodes in the cluster.
Please help me diagnose the issue.
cheers,
Sriram