Using the JMS Binding Component

Configuring Redelivery Handling

A JMS message is typically redelivered because of an error in the processing of the message. The error may be transient or permanent.

If the error is transient, the message will eventually go through. If the error is permanent, moving messages to a different destination may be a better approach. If the message is not valuable, deleting the message is another option.

Delaying delivery of a redelivered message is useful to save CPU cycles instead of letting the message "spin" rapidly.

You can configure redelivery handling by using either of the following approaches:

Configuring Redelivery Handling from the Wizard

You can use a wizard to create a concrete WSDL document that contains JMS binding and service information. The wizard is described in Creating JMS-Based Concrete WSDL Documents.

You can configure redelivery handling from the following wizard steps:

Click the Details button, which appears to the right of the Redelivery field. The Redelivery Information dialog box appears.

Screen capture of the Redelivery Information dialog box.

The Redelivery Information dialog box contains the following fields:

Configuring Redelivery Handling by Editing the WSDL Document

You can configure redelivery handling by entering a specially formatted string in a WSDL document.

The string specifies what actions to take when the message is repeatedly redelivered. The string has the following format:


format := entry[; entry]*
entry := index ":" action
index := number (denotes the n-th time a message is seen)
action := number (denotes delay in milliseconds) | "delete" | "move"(args)
move := "queue"|"topic" | "same" ":" destname
destname := any string, may include "$", which is replaced with the original 
destination name

Redelivery Handling Example 1

Assume that the string is set as follows:


redeliveryHandling="5:1000; 10:5000"

This example causes no delay up to the 5th delivery. When the message is seen for the 5th, 6th, 7th, 8th, and 9th time, a 1000–millisecond delay is invoked. For each time the message is seen thereafter, a 5000–millisecond delay is invoked.

Redelivery Handling Example 2

Assume that the string is set as follows:


redeliveryHandling="5:1000; 10:5000; 50:move(queue:mydlq)"

This example causes no delay up to the 5th delivery. When the message is seen for the 5th, 6th, 7th, 8th, and 9th time, a 1000–millisecond delay is invoked. When the message is invoked for the 10th, 11th, ..., and 49th time, a 5000–millisecond delay is invoked. When the message is seen for the 50th time, the message is moved to a queue called mydlq.

Assume that the messages are received from Queue1 and the string is set as follows:


redeliveryHandling="5:1000; 10:5000; 50:move(queue:dlq$oops)"

In thise case, the messages are moved to the destination dlqQueue1oops. The dollar sign ($) character denotes the original destination name. Instead of queue, you can specify topic or same. The value same denotes a queue if the message was received from a queue, or can denote a topic if the message was received from a topic.