WebLogic JMS Tuning in Detail using WLST

Overview:

WebLogic JMS tuning involves optimizing the performance of the JMS server by configuring various JMS-related parameters. This can include configuring connection factories, queues, topics, message delivery modes, and more. Proper tuning can lead to improved message throughput, reduced latency, and better overall performance.

Some key areas for WebLogic JMS tuning include:

  1. Connection factory tuning: This involves configuring various parameters such as maximum connections, idle timeout, and connection timeout to optimize the performance of the connection factory.
  2. Queue and topic tuning: This involves configuring various parameters such as message thresholds, delivery modes, and paging to optimize the performance of queues and topics.
  3. Message compression: This involves enabling message compression to reduce the size of messages and improve performance over slow or congested networks.
  4. Store and forward: This involves configuring store and forward to allow messages to be stored temporarily if the destination is unavailable, and then forwarded when the destination becomes available again.
  5. Message-driven bean (MDB) tuning: This involves configuring various parameters such as message selector, transaction timeout, and thread pool size to optimize the performance of MDBs.
  6. Message throttling: This involves configuring message throttling to limit the rate at which messages are sent or received, which can improve overall system stability and reduce the risk of overload.
  7. JMS bridge tuning: This involves configuring various parameters such as bridge destination, forward delay, and batch size to optimize the performance of JMS bridges.
  8. JMS server configuration: This involves configuring various parameters such as connection factory settings, messaging bridge settings, and destination settings to optimize the performance of the JMS server as a whole.
  9. Monitoring and management: This involves using tools such as the WebLogic console, JMX monitoring, and WLST scripting to monitor and manage the performance of the JMS server in real-time.
  10. Testing and benchmarking: This involves using load testing and benchmarking tools to measure the performance of the JMS server and identify areas for further optimization.

Here are 8 WLST script examples for tuning WebLogic JMS:

Set the maximum message size for a JMS queue:

connect('weblogic', 'weblogic1', 't3://localhost:7001')
edit()
startEdit()
cd('/')
cd('/JMSSystemResources/myJmsModule/JMSResource/myJmsModule/Queues/myQueue')
cmo.setMaximumMessageSize(1024)
save()
activate()

This script sets the maximum message size to 1024 bytes for the JMS queue ‘myQueue’.

Set Redelivery Limit for JMS Queue:

This script sets the redelivery limit for a JMS queue to 5

connect('weblogic', 'weblogic123', 't3://localhost:7001')
edit()
startEdit()

cd('/JMSSystemResources/<JMS_MODULE_NAME>/JMSResource/<JMS_MODULE_NAME>')
cd('Queues/<QUEUE_NAME>')

cmo.setRedeliveryLimit(5)

save()
activate()

Set the threshold value for the number of messages in a JMS queue

connect('weblogic', 'weblogic1', 't3://localhost:7001')
edit()
startEdit()
cd('/')
cd('/JMSSystemResources/myJmsModule/JMSResource/myJmsModule/Queues/myQueue')
cmo.setThresholds(200, 250)
save()
activate()

This script sets the threshold value for the number of messages in ‘myQueue’ to 200 messages for the low threshold and 250 messages for the high threshold.

Set the number of consumers for a JMS topic:

connect('weblogic', 'weblogic1', 't3://localhost:7001')
edit()
startEdit()
cd('/')
cd('/JMSSystemResources/myJmsModule/JMSResource/myJmsModule/Topics/myTopic')
cmo.setSubscriptionSharingPolicy('Exclusive')
cmo.setSubscriptionCount(10)
save()
activate()

This script sets the subscription sharing policy to ‘Exclusive’ and sets the number of consumers to 10 for the JMS topic ‘myTopic’.

Set the time-to-live (TTL) for JMS messages:

connect('weblogic', 'weblogic1', 't3://localhost:7001')
edit()
startEdit()
cd('/')
cd('/JMSSystemResources/myJmsModule/JMSResource/myJmsModule/Queues/myQueue')
cmo.setTimeToLive(60000)
save()
activate()

This script sets the time-to-live (TTL) for messages in the JMS queue ‘myQueue’ to 60,000 milliseconds (1 minute).

Set the connection factory maximum capacity:

connect('weblogic', 'weblogic1', 't3://localhost:7001')
edit()
startEdit()
cd('/')
cd('/JMSSystemResources/myJmsModule/JMSResource/myJmsModule/ConnectionFactories/myConnectionFactory')
cmo.setMaxCapacity(100)
save()
activate()

This script sets the maximum capacity for the JMS connection factory ‘myConnectionFactory’ to 100.

Set the message delivery mode for JMS messages:

connect('weblogic', 'weblogic1', 't3://localhost:7001')
edit()
startEdit()
cd('/')
cd('/JMSSystemResources/myJmsModule/JMSResource/myJmsModule/Queues/myQueue')
cmo.setDefaultDeliveryMode('Persistent')
save()
activate()

This script sets the default delivery mode for messages in the JMS queue ‘myQueue’ to ‘Persistent’.

Increase Concurrent Consumers for JMS Queue:

This script increases the concurrent consumers for a JMS queue to 10.

connect('weblogic', 'weblogic123', 't3://localhost:7001')
edit()
startEdit()

cd('/JMSSystemResources/<JMS_MODULE_NAME>/JMSResource/<JMS_MODULE_NAME>')
cd('Queues/<QUEUE_NAME>')

cmo.setConcurrentConsumers(10)

save()
activate()

Cheers!!!

About the author

Mohit Chaudhary

Hey there, I am IT enthusiast who is passionate about Middleware, DevOps, Cloud and much more.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *