Using an MDB that always rolls back a message to test the handling of poison messages (WebSphere MQ V7.x, WebSphere Application Server V7 and V8.x)

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 and V8.x, which interacts with WebSphere MQ V7.x 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

Requisite software
  • SUSE Linux Enterprise Server (SLES) 9:
  • WebSphere Application Server 7.0.0.5 or later
  • WebSphere MQ 7.0.0.2 or later
  • 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

DISCLAIMER: All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

WAS7_MQ7_MDB_PoisonMessages.pdfWAS7_MQ7_MDB_PoisonMessages.pdf
File name: WAS7_MQ7_MDB_PoisonMessages.pdf
File size: 500 KB

SamplePoisonMsgMdbEjbEAR.ear
File name: SamplePoisonMsgMdbEjbEAR.ear
File size: 4 KB

onMessage-setRollbackOnly.txt
File name: onMessage-setRollbackOnly.txt
File size: 2 KB

Cross reference information
Segment Product Component Platform Version Edition
Application Servers WebSphere Application Server Java Message Service (JMS) AIX, HP-UX, Linux, Solaris 8.5, 8.0, 7.0

Product Alias/Synonym

WebSphere MQ WMQ Application Server WAS WSAS

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere MQ
Capability

Software version:

7.0, 7.1, 7.5

Operating system(s):

AIX, HP Itanium, Linux, Solaris, Windows

Reference #:

7016582

Modified date:

2013-10-11

Translate my page

Machine Translation

Content navigation