White paper
Abstract
Demonstrate the use of a simple Message Driven Bean (MDB) in WebSphere Application Server V7, which interacts with WebSphere MQ V7 as the Java™ Messaging Service (JMS) provider. This MDB always rolls back a message and therefore indicating it as a “poison message”. This MDB can be used to better understand the handling of poison messages by the WebSphere Application Server and MQ.
Content
The document is provided in the attached file: WAS7_MQ7_MDB_PoisonMessages.pdf
This demonstrates the use of a simple Message Driven Bean (MDB) in WebSphere Application Server V7, which interacts with WebSphere MQ V7 as the Java Messaging Service (JMS) provider.
This MDB always rolls back a message and the transaction does not complete successfully. This action indicates that the message is a “poison message”. This MDB can be used to better understand the handling of poison messages by the WebSphere Application Server and MQ.
Furthermore, with this MDB you can experiment with the different parameters of WebSphere Application Server and WebSphere MQ.
WebSphere Application Server:
Listener Port: Maximum retries (default is 0)
Activation Specification: Number of sequential delivery failures before suspending endpoint (default is 0)
WebSphere MQ:
Queue: Backout Threshold => BOTHRESH (default is 0)
Backout Queue => BOQNAME (default is null)
This document has the following chapters:
Using Listener Port
Scenario 1
- Setup for Scenario 1: using defaults for Listener Port and Queue
- Testing of the Scenario 1: using defaults for Listener Port and Queue
Scenario 2
- Setup for Scenario 2: using “Maximum retries” (2) for LP and backout queue and backout threshold (1) for Queue
- Testing of the Scenario 2: using “Maximum retries” (2) for LP and backout queue and backout threshold (1) for Queue
Using Activation Specification
Scenario 3
- Setup for Scenario 3: using defaults for Activation Specification and Queue
- Testing of the Scenario 3: using defaults for Activation Specification and Queue
Scenario 4
- Setup for Scenario 4: using “delivery failures ” (1) for ActSpec and backout queue and backout threshold (1) for Queue
- Testing of the Scenario 4: using “delivery failures” (1) for ActSpec and backout queue and backout threshold (1) for Queue
Related techdocs and articles
- This techdoc is based on the configuration, deployment and test steps described in the following techdoc. Using WebSphere MQ V7 as JMS Provider for WebSphere Application Server V7http://www.ibm.com/support/docview.wss?rs=171&uid=swg27016505
- The MDB was created with Rational Application Developer (RAD) 7.5 and the Enterprise Archive File (EAR) file which contains the MDB can be downloaded from this techdoc. For more details on how to create and test this MDB, see the following techdoc: Developing and testing an MDB using RAD 7.5, WebSphere Application Server V7 and MQ V7 as JMS Provider http://www.ibm.com/support/docview.wss?rs=171&uid=swg27016507
- Excellent article on Poison Messages: How WebSphere Application Server V6 handles poison messages. This article describes how poison JMS messages can be handled by JMS provided with WebSphere Application Server, how the default behavior can be modified, and how the behavior changes if WebSphere MQ is used as the message service provider. http://www.ibm.com/developerworks/websphere/library/techarticles/0803_titheridge/0803_titheridge.html
Requisite software
- SUSE Linux Enterprise Server (SLES) 9:
- WebSphere Application Server 7.0.0.5
- WebSphere MQ 7.0.0.2
- Firefox (also known as Mozilla)
Downloadable files
- WAS7_MQ7_MDB_PoisonMessages.pdf
- EAR file with MDB: SamplePoisonMsgMdbEjbEAR.ear
- Text file with code excerpt: onMessage-setRollbackOnly.txt
| Segment | Product | Component | Platform | Version | Edition |
|---|---|---|---|---|---|
| Application Servers | WebSphere Application Server | Java Message Service (JMS) | AIX, HP-UX, Linux, Solaris | 7.0 |
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.