weblogic jms system best practices
TRANSCRIPT
2014 © Trivadis
BASEL BERN BRUGG LAUSANNE ZUERICH DUESSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA
2014 © Trivadis
WebLogic JMS System Best Practices
Daniel Joray
Date
View > Header and footer1
2014 © Trivadis
Trivadis ist führend bei der IT-Beratung, der Systemintegration,
dem Solution-Engineering und der Erbringung von IT-Services
mit Fokussierung auf und Technologien
im D-A-CH-Raum.
Unsere Leistungen erbringen wir aus den strategischen Geschäftsfeldern:
Trivadis Services übernimmt den korrespondierenden Betrieb
Ihrer IT Systeme.
Unser Unternehmen
30.09.2014
Trivadis – das Unternehmen
B E T R I E B
2
2014 © Trivadis
Mit über 600 IT- und Fachexperten bei Ihnen vor Ort
3
12 Trivadis Niederlassungen mitüber 600 Mitarbeitenden
200 Service Level Agreements
Mehr als 4'000 Trainingsteilnehmer
Forschungs- und Entwicklungs-budget: CHF 5.0 Mio. / EUR 4.0 Mio.
Finanziell unabhängig undnachhaltig profitabel
Erfahrung aus mehr als 1'900 Projekten pro Jahr bei über 800 Kunden
Stand 12/2013
Hamburg
Düsseldorf
Frankfurt
FreiburgMünchen
Wien
Basel
ZürichBernLausanne
3
Stuttgart
30.09.2014
Trivadis – das Unternehmen3
Brugg
2014 © Trivadis
Trivadis – das Unternehmen
Trivadis an der DOAG
Ebene 3 - gleich neben der Rolltreppe
Wir freuen uns auf Ihren Besuch.
Denn mit Trivadis gewinnen Sie immer.
2014 © Trivadis
1. Java Messaging Systems
2. Java Messaging System in Weblogic
3. JMS Servers
4. Persistent Stores
5. JMS Modules
6. JMS Resources
7. Best Practices
AGENDA
30.09.2014
Java Messaging Service in Weblogic5
2014 © Trivadis
Date
View > Header and footer
Java Messaging Systems
6
2014 © Trivadis
Java Messaging Systems
Messaging systems are used to build highly reliable, scalable, and flexible distributed applications.
A messaging system allows separate, uncoupled applications to reliably communicate asynchronously.
The messaging system architecture generally replaces the client/server model with a peer-to-peer relationship between individual components, where each peer can send and receive messages to and from other peers.
This permits dynamic, reliable, and flexible systems to be built, whereby entire ensembles of sub-applications can be modified without affecting the rest of the system.
.
30.09.2014
Java Messaging Service in Weblogic7
2014 © Trivadis
Java Messaging Systems
Messaging systems include high scalability (ability to support tens of thousands of clients and tens of thousands of operations per second), easy integration into heterogeneous networks, and reliability due to lack of a single point of failure.
Messaging systems provide a host of powerful advantages over other, more conventional distributed computing models.
They encourage "loose coupling" between message consumers and message producers.
There is a high degree of anonymity between producer and consumer. The message consumer doesn't matter who produced the message, where the producer lives on the network, or whenthe message was produced.
30.09.2014
Java Messaging Service in Weblogic8
2014 © Trivadis
Java Messaging Systems
Two messaging systems models are in common use.
Point to Point messaging systems, messages are routed to an individual consumer which maintains a queue of "incoming" messages. Messaging applications send messages to a specified queue, and clients retrieve messages from a queue.
Publish/Subscribe (pub/sub) messaging system supports an event driven model where information consumers and producers participate in the transmission of messages. Producers "publish" events, while consumers "subscribe" to events of interest, and consume the events. Producers associate messages with a specific topic, and the messaging system routes messages to consumers based on the topicsthe consumers register interest in.
30.09.2014
Java Messaging Service in Weblogic9
2014 © Trivadis
Java Messaging Systems
A JMS message structure
Message header is used for message identification. The header is used to determine if a given message is appropriate for a "subscriber"
In message header you find field like MessageID, Timestamp , DeliveryMode , Expiration , Priority, etc.
Properties (optional) is used for application-specific, provider-specific, and optional header fields
Body holds the content of the message. Several formats are supported, including TextMessages, ObjectMessages, BytesMessages, etc.
30.09.2014
Java Messaging Service in Weblogic10
Message
Header Properties Message body
2014 © Trivadis
Java Messaging Systems
Message size has a direct impact on the message throughput
30.09.2014
Java Messaging Service in Weblogic11
0
200
400
600
800
1000
1200
1400
1600
1800
2000
1 2 5 10 20 50
Msg
/Sec
Message in Kb / Store Location Disk
Write
Read
2014 © Trivadis
Java Messaging Systems
JMS Connection
30.09.2014
Java Messaging Service in Weblogic12
qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);qcon = qconFactory.createQueueConnection();qsession = qcon.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup(queueName);qsender = qsession.createSender(queue);
msg = qsession.createTextMessage();
2014 © Trivadis
Date
View > Header and footer
Java Messaging System in Weblogic
13
2014 © Trivadis
Java Messaging Systems Weblogic
Weblogic server is compliant with the JMS 1.1 specification
As JMS provider, Weblogic Server includes the use of JNDI for lookup purpose, JMS servers, JMS configuration modules and persistent stores.
Additional JMS-related resources can be used by JMS Servers and JMS Module like
Path Service
JMS-Store-and-forward
Messaging bridges
30.09.2014
Java Messaging Service in Weblogic14
2014 © Trivadis
Java Messaging Systems Weblogic
Schema from a Weblogic JMS System
30.09.2014
Java Messaging Service in Weblogic15
Weblogic DomainJNDITree
CF
JMS Server
JMS ModuleQueue
Persistent Store
MessagesConsumer
MessagesProducer
2014 © Trivadis
Date
View > Header and footer
JMS Servers
16
2014 © Trivadis
JMS Servers
A JMS server is an environment-related configuration entity that acts as management container for JMS queue and topic resources defined within JMS modules that are targeted to specific that JMS server.
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.
You can target a JMS server to either an independent Weblogic Server instance or to a migratable target server where it will be deployed.
30.09.2014
Java Messaging Service in Weblogic17
2014 © Trivadis
JMS Servers
A JMS Server belongs to a single Weblogic Server instance, and the same instance can host multiple JMS Servers
You can target multiple JMS modules to each JMS Server
If You need persistence for your messages, You must configure the JMS Server to use a persistent store and target the JMS Server to the same target as that for the persistent store
Multiple JMS Servers can share the same persistent store
30.09.2014
Java Messaging Service in Weblogic18
2014 © Trivadis
JMS Servers (Paging)
With the message paging feature, JMS servers automatically attempt to free up virtual memory during peak message load periods.
Message paging is always enabled on JMS servers, and so a message paging directory is automatically created without having to configure one, but you can specify a different directory if you wish.
JMS message paging saves memory for persistent messages, as even persistent messages cache their data in memory.
If a JMS server is associated with a file store (either user-defined or the server’s default store), paged persistent messages are generally written to that file store, while nonpersistent messages are always written to the JMS server’s paging directory.
If a JMS server is associated with a JDBC store, then both paged persistent and non-persistent messages are always written to the JMS server’s paging directory.
30.09.2014
Java Messaging Service in Weblogic19
2014 © Trivadis
JMS Servers (Paging)
If a Paging Directory is not specified for a JMS server, paged-out message bodies are written to the default ./tmp directory inside the host server's root directory (<domain>/servers/<server>).
The Message Buffer Size JMS server attribute specifies the amount of memory that will be used to store message bodies in memory before they are paged out to disk. The default value is approximately one-third of the maximum heap size for the JVM or 512Mb, whichever is larger.
Paged-out message does not free all the memory that it consumes, because the message header remains in memory for use with searching, sorting, and filtering
Expiration Scan Interval set the number of seconds between this JMS server's cycles of scanning local destinations for expired messages (Default 30 sec)
30.09.2014
Java Messaging Service in Weblogic20
2014 © Trivadis
JMS Servers (Paging)
Paging cost can be very expensive
30.09.2014
Java Messaging Service in Weblogic21
0
200
400
600
800
1000
1200
1400
1600
1800
00:0
0.0
00:0
3.0
00:0
6.0
00:0
9.0
00:1
2.0
00:1
5.0
00:1
8.0
00:2
1.0
00:2
4.0
00:2
7.0
00:3
0.0
00:3
3.0
00:3
6.0
00:3
9.0
00:4
2.0
00:4
5.0
00:4
8.0
00:5
1.0
00:5
4.0
00:5
7.0
01:0
0.0
Messages Per Second (Paging File Size 0)
Messages Per Second (Paging File Size 2Gb)
2014 © Trivadis
JMS Servers (Parameters)
Bytes Threshold High and Bytes Threshold Low specifies upper and lower threshold for the number of bytes stored on the JMS server, those triggers flow control and logging events
Messages Threshold High and Messages Threshold Low specifies upper and lower threshold for the of messages stored on the JMS server, those triggers flow control and logging events
Blocking Send Policy determines whether the JMS server delivers smaller messages before larger ones when a destination has exceeded its maximum number of messages (default is FIFO)
Maximum Message Size sets the maximum number of bytes allowed in individual messages on this JMS server
30.09.2014
Java Messaging Service in Weblogic22
2014 © Trivadis
JMS Servers (Logging)
JMS server logs provide useful information relating to the production and consumption of messages.
you can configure how the server write this information with parameters like Log file name, Rotation type, Rotation file size and Limit number of retained files
To activate Messages Logging you should enable the logging information when you create the JMS destination such a queue or a topic
30.09.2014
Java Messaging Service in Weblogic23
2014 © Trivadis
JMS Servers (Monitor)
You can monitor running JMS Servers from Administration Console or from WLST.
30.09.2014
Java Messaging Service in Weblogic24
2014 © Trivadis
Date
View > Header and footer
Persistent Stores
25
2014 © Trivadis
Persistent Stores
A persistent store provides a built-in, high-performance storage solution for Weblogic Server subsystems and services that require persistence
The persistent store supports persistence to a file-based store (File Store) or to a JDBC-enabled database (JDBC Store).
You can target a persistent store only to one servers or to a migratabletarget server
To create a File Store the path set in parameter Directory muss exist. For highest availability, use either a Storage Area Network (SAN) or a dual-ported SCSI disk.
With the parameter Synchronous Write Policy you can define how hard a file store will try to flush records to the disk. The available values are: Direct-Write (default), Cache-Flush, and Disabled.
30.09.2014
Java Messaging Service in Weblogic26
2014 © Trivadis
Persistent Stores
You can configure for each FileStore the Synchronous Write Policy
30.09.2014
Java Messaging Service in Weblogic27
0
200
400
600
800
1000
1200
1400
1600
1800
2000
00:0
0.0
00:0
3.0
00:0
6.0
00:0
9.0
00:1
2.0
00:1
5.0
00:1
8.0
00:2
1.0
00:2
4.0
00:2
7.0
00:3
0.0
00:3
3.0
00:3
6.0
00:3
9.0
00:4
2.0
00:4
5.0
00:4
8.0
00:5
1.0
00:5
4.0
00:5
7.0
01:0
0.0
Messages Per Second (Direct Write)
Messages Per Second (Disable)
Messages Per Second (Cash Flush)
2014 © Trivadis
Persistent Stores Best Practices
For subsystems (JMS Server) that share the same server instance, share one store between multiple subsystems rather than using a store per subsystem.
Sharing a store is more efficient for the following reasons
A single store batches concurrent requests into single I/Oswhich reduces overall disk usage.
Transactions in which only one resource participates are lightweight one-phase transactions. Conversely, transactions in which multiple stores participate become heavier weight two-phase transactions.
Add a new store only when the old store(s) no longer scale.
30.09.2014
Java Messaging Service in Weblogic28
2014 © Trivadis
Persistent Stores
To create a JDBC Store you need a Datasource
You cannot specify a JDBC data source that is configured to support global (XA) transactions
The specified JDBC data source must use a non-XA JDBC driver
You cannot enable Logging Last Resource or Emulate Two-Phase Commit in the data source
This limitation does not remove the XA capabilities of layered subsystems that use JDBC stores
Weblogic JMS is fully XA-capable regardless of whether it uses a file store or any JDBC store
Multiple stores cannot share the same table.
30.09.2014
Java Messaging Service in Weblogic29
2014 © Trivadis
Persistent Stores
WLS will automatically attempt to create the required table if
The table is not already present
The data source credentials have “Create” rights
The data source vendor type is not “Other”
A matching DDL file is found for the data source type
You can chose the prefix from the table [prefixWLStore]
Store DDL files for standard vendors are found within the archive:
<WL_HOME>/modules/com.bea.core.store.jdbc_xxx.jar
For Oracle databases, the default DDL used is oracle.ddl, this DLL create a table who the record is save in a LONG RAW Colum.
You can change the default DDL whit Create Table from DDL File field. oracle_blob.ddl is available that uses a BLOB data type instead of the default LONG RAW type.
30.09.2014
Java Messaging Service in Weblogic30
2014 © Trivadis
Persistent Stores Performance
Not all stores have the same performance
30.09.2014
Java Messaging Service in Weblogic31
0
200
400
600
800
1000
1200
1400
1600
1800
2000
00:0
0.0
00:0
2.0
00:0
4.0
00:0
6.0
00:0
8.0
00:1
0.0
00:1
2.0
00:1
4.0
00:1
6.0
00:1
8.0
00:2
0.0
00:2
2.0
00:2
4.0
00:2
6.0
00:2
8.0
00:3
0.0
00:3
2.0
00:3
4.0
00:3
6.0
00:3
8.0
00:4
0.0
00:4
2.0
00:4
4.0
00:4
6.0
00:4
8.0
00:5
0.0
00:5
2.0
00:5
4.0
00:5
6.0
00:5
8.0
01:0
0.0
Write MPS (Disk)
Write MPS (NFS)
Write MPS (Memory)
Write MPS (JDBC)
Read MPS (Disk)
Read MPS (NFS)
Read MPS (Memory)
Read MPS (JDBC)
2014 © Trivadis
Date
View > Header and footer
JMS Modules
32
2014 © Trivadis
JMS Modules
JMS modules are application-related definitions that are independent of the domain environment
JMS modules are globally available for targeting to servers and clusters configured in the domain, and therefore are available to all applications deployed on the same targets and to client applications
The following configuration resources are defined as part of a system module or an application module Connection factories
Queue and topic destinations
Templates
Destination keys
Quota
Distributed destinations (Queue or Topic)
Foreign servers
JMS store-and-forward (SAF) configuration items
30.09.2014
Java Messaging Service in Weblogic33
2014 © Trivadis
JMS Modules
Not all JMS Resource in a JMS Module have the same target. In this case you can use Sub-Deployment to define a specific physical target to a JMS Resource
30.09.2014
Java Messaging Service in Weblogic34
Server
JMS Server 1
Server
JMS Server 2
JMS Module
Sub-Deployment
Sub-Deployment
Queue
Queue
Topic
ConnectionFactory
2014 © Trivadis
Date
View > Header and footer
JMS Resources
35
2014 © Trivadis
JMS Resources (Connection Factory)
A Connection Factory encapsulates connection configuration information, and enables JMS applications to create a Connection.
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
The Connection Factory allow you to configure parameters like timeout, delivery mode, transaction management and load balancing management
30.09.2014
Java Messaging Service in Weblogic36
2014 © Trivadis
JMS Resources (Connection Factory Parameters)
Default Delivery main parameter are:
Default Priority: The default priority used for messages when a priority is not explicitly defined
Default Time-to-Live: The maximum length of time, in milliseconds, that a message exists
Default Time-to-Deliver: The delay time, in milliseconds, between when a message is produced and when it is made visible on its destination
Default Delivery Mode: The default delivery mode used for messages when a delivery mode is not explicitly defined
Send Timeout: The maximum length of time, in milliseconds, that a sender will wait when there isn't enough available space (no quota) on a destination to accommodate the message being sent.
30.09.2014
Java Messaging Service in Weblogic37
2014 © Trivadis
JMS Resources (Connection Factory Parameters)
Client main parameters are:
Client ID Policy: The Client ID Policy indicates whether more than one JMS connection can use the same Client ID
Subscription Sharing Policy: Specifies the subscription sharing policy on this connection.
Maximum Messages per Session: The maximum number of messages that can exist for an asynchronous session and that have not yet been passed to the message listener
Transactions main parameters are:
XA Connection Factory Enabled: Indicates whether a XA queue or XA topic connection factory is returned, instead of a queue or topic connection factory.
Transaction Timeout: The timeout value (in seconds) for all transactions on connections created with this connection factory
30.09.2014
Java Messaging Service in Weblogic38
2014 © Trivadis
JMS Resources (Connection Factory Parameters)
Load Balance main parameters are:
Load Balancing Enabled: Specifies whether non-anonymous producers created through a connection factory are load balanced within a distributed destination on a per-call basis.
Server Affinity Enabled: Specifies whether a server instance that is load balancing consumers or producers across multiple members destinations of a distributed destination, will first attempt to load balance across any other physical destinations that are also running on the same server instance.
30.09.2014
Java Messaging Service in Weblogic39
2014 © Trivadis
JMS Resources (Connection Factory Parameters)
Flow Control main parameters are:
Flow Control Enabled: Specifies whether a producer created using a connection factory allows flow control. If true, the associated message producers will be slowed down if a JMS server or a destination reaches its specified upper byte or message threshold
Flow Maximum: The maximum number of messages-per-second allowed for a producer that is experiencing a threshold condition. When a producer is flow controlled it will never be allowed to go faster than the Flow Maximum messages per second
30.09.2014
Java Messaging Service in Weblogic40
2014 © Trivadis
JMS Resources (Destination Keys)
Destination Key defines a unique sort order that destinations can apply to arriving messages.
As messages arrive on a specific destination, by default they are sorted in FIFO (first-in, first-out) order, which sorts ascending based on each message's unique JMSMessageID.
You can use a destination key to configure a different sorting scheme for a destination, such as LIFO (last-in, first-out).
Parameters
Sort Key: Specifies a message property name. Like JMSMessageID, JMSTimestamp, JMSPriority, User-Defined, ect.
Key Type: the expected property type for this destination key
Direction: The direction
30.09.2014
Java Messaging Service in Weblogic41
2014 © Trivadis
JMS Resources (Quota)
Quota controls the allotment of system resources available to destinations
Bytes Maximum: The total number of bytes that can be stored in a destination that uses this quota
Messages Maximum: The total number of messages that can be stored in a destination that uses this quota
Policy: For destinations that use this quota, this policy determines whether to deliver smaller messages before larger ones when a destination has exceeded its message quota, you can choose between FIFO or PREEMTIVE
Shared: Indicates whether this quota is shared by multiple destinations that refer to it
30.09.2014
Java Messaging Service in Weblogic42
2014 © Trivadis
JMS Resources (Templates)
JMS Template defines a set of default configuration settings for multiple destinations
The configurable options for a JMS template are the same as those configured for a destination
If the destination that is using a JMS template specifies an override value for an option, the override value is used
The JNDI Name, Enable Store, and Template options are not defined for JMS templates
You can configure subdeployments for error destinations, so that any number of destination subdeployments will use only the error destinations specified in the corresponding template
30.09.2014
Java Messaging Service in Weblogic43
2014 © Trivadis
JMS Resources (Queue)
Queue defines a point-to-point destination type, which are used for asynchronous peer communications. A message delivered to a queue is distributed to only one consumer
30.09.2014
Java Messaging Service in Weblogic44
Producer
Message
Queue
Consumer
Message
2014 © Trivadis
JMS Resources (Topic)
Topic defines a publish/subscribe destination type, which are used for asynchronous peer communications. A message delivered to a topic is distributed to all topic consumers
30.09.2014
Java Messaging Service in Weblogic45
Producer
Message
Topic
Consumer 1
Consumer 2
Consumer 3
Consumer 4
Message
Message
2014 © Trivadis
JNDI NameJms/myDistributedQueue
JMS Resources (Distributed Destination)
Distributed Queue defines a set of queues that are distributed on multiple JMS servers, but which are accessible as a single, logical queue to JMS clients
Ditributed Topic defines a set of topics that are distributed on multiple JMS servers, but which are accessible as a single, logical topic to JMS clients.
30.09.2014
Java Messaging Service in Weblogic46
Producer
MessageQueueServer1
Consumer
Message
QueueServer 2
2014 © Trivadis
JMS Resources (Distributed Destination)
Two types of distributed queues are available
Uniform Distributed Queue
Queue members are created uniformly from a common configuration.
30.09.2014
Java Messaging Service in Weblogic47
2014 © Trivadis
JMS Resources (Distributed Destination)
Distributed Queue
Queue members are created and weighted individually to fine tune performance
30.09.2014
Java Messaging Service in Weblogic48
2014 © Trivadis
JMS Resources (High Available)
You can establish load balancing of destinations across multiple servers in the cluster by configuring multiple JMS servers and targeting them to the defined Weblogic Servers
Each JMS server is deployed on exact one Weblogic Server instance and handles requests for a set of destinations
Load balancing is not dynamic. During the configuration phase, the system administrator defines load balancing by specifying targets for JMS servers
If your JMS resource should be high available, you have to migrate your JMS Server
Weblogic support whole server migration and service migration (automatic and manual)
30.09.2014
Java Messaging Service in Weblogic49
2014 © Trivadis
JMS Resources (Server Migration)
.
30.09.2014
Java Messaging Service in Weblogic50
Host 1
NFS / JDBC stores
Host 2
Testsrv2Ip 10.0.10.70
tqueuesrv2JMSServer2
Filestoresrv2_NFS
Deployed applications
Testsrv2Ip 10.0.10.70
tqueuesrv2JMSServer2
Filestoresrv2_NFS
Deployed applications
Testsrv3Ip 10.0.10.80
2014 © Trivadis
JMS Resources (Service Migration)
.
30.09.2014
Java Messaging Service in Weblogic51
Host 1
NFS / JDBC stores
Host 2
Testsrv2Ip 10.0.10.70
tqueuesrv2JMSServer2
Filestoresrv2_NFS
Deployed applications
Testsrv3Ip 10.0.10.80
Testsrv3Ip 10.0.10.80
tqueuesrv2JMSServer2
Filestoresrv2_NFS
2014 © Trivadis
JMS Resources (Distributed Destination)
Distribution of application load across multiple JMS servers through connection factories, thus reducing the load on any single JMS server and enabling session concentration by routing connections to specific servers.
.
30.09.2014
Java Messaging Service in Weblogic52
0
500
1000
1500
2000
2500
00:0
0.0
00:0
3.0
00:0
6.0
00:0
9.0
00:1
2.0
00:1
5.0
00:1
8.0
00:2
1.0
00:2
4.0
00:2
7.0
00:3
0.0
00:3
3.0
00:3
6.0
00:3
9.0
00:4
2.0
00:4
5.0
00:4
8.0
00:5
1.0
00:5
4.0
00:5
7.0
01:0
0.0
Queue
Distributed Queue
2014 © Trivadis
Date
View > Header and footer
Best Practices
53
2014 © Trivadis
Server 2
CPU IO MemoryParameters
Server 1
CPU IO MemoryParameters
Best Practices
Tuning a JMS System in Weblogic can be very complex…
30.09.2014
Java Messaging Service in Weblogic54
Client
CPUIO
Memory
WLS Server1
JVMMemory
Parameters
WLS Server2
JVMMemory
Parameters
WLS-Cluster
Netw
ork
Server 3
CPU IO Memory
DatabaseMemory
Parameters
NFS Shares
2014 © Trivadis
Best Practices (How to choice the right configuration)
What is important for your Application?
Producer insertion
Consumer reliability
Throughput
Message Order
Persistence
And you should answer those questions for each JMS resource
30.09.2014
Java Messaging Service in Weblogic55
2014 © Trivadis
Best Practices (How to make your tests)
Monitor CPU, disk I/O, memory, network interfaces from all involved systems
At the beginning of each test, stop the Weblogic systems and clean-up or remove persistent store, paging files, truncate store tables
Configure your environment with WLST scripts ( TVD-Basenv™ can help you)
Use a load generator (Jmeter, LoadUi, Grinder, Java function)
Document each test case, a the beginning, use only short test case, when you have reached your targets with short test, you can make long-term test
30.09.2014
Java Messaging Service in Weblogic56
2014 © Trivadis
Best Practices (JMS Server and Store)
Create a custom store on each Weblogic server which will host a JMS server. (Why use a custom store? Custom stores provide more flexibility in tuning and administration. In addition, the default file store is not migratable -- only custom stores are migratable.)
It is recommended to always target to migratable targets when available
Configure message count quotas on each JMS server. There is no default quota, so configuring one helps protect against out-of-memory conditions. Rule of thumb: conservatively assume that each message consumes 512 bytes of memory even if it is paged out.
30.09.2014
Java Messaging Service in Weblogic57
2014 © Trivadis
Best Practices (JMS Server and Store)
Although JMS paging is enabled by default, verify that the default behavior is valid for your environment
Specify a Message Paging Directory. The default value is
$MW_HOME\user_projects\domains\domainname\servers\servername\tmp
Message Paging Directory must not be placed on the same disk as persistent store
Tuning the Message Buffer Size Option, to specifies the amount of memory that will be used to store message bodies in memory before they are paged out to disk.
It is important to remember that this parameter is not a quota
30.09.2014
Java Messaging Service in Weblogic58
2014 © Trivadis
Best Practices (JMS Module)
It is almost always preferable to use system modules instead of deployable application modules. The only way to modify deployable modules is to manually edit the XML and redeploy.
Create exactly one subdeployment per module. It's much easier for third parties to understand the targeting, and it reduces the chances of making configuration errors. If a single subdeployment is not sufficient, create two modules.
Populate the subdeployment only with JMS servers - not Weblogicservers. For modules that support non-distributed destinations, the subdeployment must only reference a single JMS Server.
30.09.2014
Java Messaging Service in Weblogic59
2014 © Trivadis
Best Practices (JMS Module)
Configure the distributed queue to enable forwarding. Distributed queue forwarding automatically internally forwards messages that have been idled on a member destination without consumers to a member that has consumers
It is highly recommended to always configure message count quotas. Quotas help prevent large message backlogs from causing out-of-memory errors, and Weblogic JMS does not set quotas by default
Configure Messages Expiration Policies
Configure Flow Control
Configure One-Way Message Send and Windows Size
30.09.2014
Java Messaging Service in Weblogic60
2014 © Trivadis
Best Practices (JMS Module)
Configure Redelivery Limit, the number of redelivery tries a message can have before it is moved to the error
Configure Error Destination, name of the target error destination for messages that have expired or reached their redelivery limit. If no error destination is configured, then such messages are simply dropped.
30.09.2014
Java Messaging Service in Weblogic61
2014 © Trivadis
Best Practices (Controlling the Flow of Messages)
Specifically, when either a JMS server or it’s destinations exceeds its specified byte or message threshold, it becomes armed and instructs producers to limit their message flow (messages per second).
As producers slow themselves down, the threshold condition gradually corrects itself until the server/destination is unarmed
Producers receive a set of flowcontrol attributes from their session, which receives the attributes from the connection, and which receives the attributes from the connection factory
30.09.2014
Java Messaging Service in Weblogic62
0
50
100
150
200
250
100
800
1500
2200
2900
3600
4300
5000
5700
6400
7100
7800
8500
9200
9900
Message Flow Max250 Min
200
MSG / Ssec
2014 © Trivadis
Best Practices (Controlling the Flow of Messages)
First enable flow control on JMS Servers
Then configure the queue or the connection factory
30.09.2014
Java Messaging Service in Weblogic63
0
50
100
150
200
250
300
350
400
100
900
1700
2500
3300
4100
4900
5700
6500
7300
8100
8900
9700
One Producer Message size 5k
Message / sec
2014 © Trivadis
Best Practices (One-Way Message Send )
One-way message send can greatly improve the performance of applications that are bottle-necked by senders but do so at the risk of introducing a lower quality-of-service
When active, the associated producers can send messages without internally waiting for a response from the target destination's host JMS server
30.09.2014
Java Messaging Service in Weblogic64
2014 © Trivadis
Conclusion
It is not possible to predict the “JMS performances” of a system without testing
You should never see a JMS Resource like a container. The physical implementation can impact the application. Not only the performances but the workflow of application.
You can only choose the right JMS resource if you know the application.
30.09.2014
Java Messaging Service in Weblogic65
2014 © Trivadis
Further information ...
Date
View > Header and footer66
Tuning Weblogic JMShttp://docs.oracle.com/cd/E14571_01/web.1111/e13814/jmstuning.htm#CHDEBFDF
Configuring and Managing JMS for Oracle Weblogic Serverhttp://docs.oracle.com/cd/E14571_01/web.1111/e13814/jmstuning.htm#CHDEBFDF
JMS Performance Tuning Series (Darrel Sharpe)
http://developsimpler.blogspot.ch/2011/11/jms-performance-tuning-series-part-1.html
Messaging in Weblogic Server: Best Practices (René van Wijk)
http://middlewaremagic.com/weblogic/?p=6334
2014 © Trivadis
Questions and answers ...
2014 © Trivadis
BASEL BERN BRUGG LAUSANNE ZUERICH DUESSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA
Daniel Joray
Principal Consultant
Tel. +41 58 459 50 26
Date
View > Header and footer