# @common:message-buffer Annotation

The @common:message-buffer annotation specifies that there should be a queue between the component's implementation code and the message transport wire for the specified method or callback.

Note: In WebLogic Workshop 7.0, a message buffer on a method or callback was designated with the @jws:message-buffer annotation. This annotation is still supported in JWS files for backward compatibility.

Note: This annotation contains behavior specific to the Service Broker control. For more information, see Notes on Service Broker Control Annotations in the Service Broker Control documentation.

Note: This annotation contains behavior specific to the Process control. For more information, see Notes on Process Control Annotations in the Process Control documentation.

## Syntax

@common:message-buffer

[enable="true | false"]

[retry-count="number of attempts"]

[retry-delay="duration"]

## Attributes

enable

Required. Specifies whether the messages arriving or departing via the associated method or callback are queued.

retry-count

Optional. The number of times WebLogic Server will attempt to deliver queued messages to the service.

retry-delay

Optional. The amount of time that should pass between message delivery attempts.

## Remarks

The following rules apply to this annotation's use:

- Only one @common:message-buffer annotation may appear within a single Javadoc block.
- Optionally may appear in front of a @common:operation method in a JWS file.
- Optionally may appear in front of a callback method (event declaration) in a JWS file.
- Optionally may appear in front of an event handler method (control_eventName method) in a JWS file.
- Optionally may appear in front of a method declaration in a control file.

The @common:message-buffer annotation may only be placed on methods or callbacks with return type void.

The @common:message-buffer annotation places a queue between the method and the communication wire. For incoming messages, this means that the message is queued before it is processed. For outgoing messages, this means that the message is queued before it is sent on the wire.

Note that the queue is transparent to the method that is marked with the @common:message-buffer annotation. When multiple messages arrive, they may be queued (or for the client, in the case of a callback) while the method is processing a previous message. Callers invoking a buffered method or callback will always experience an immediate return.

The retry-delay attribute can be specified using friendly names for units of time. For example, the default unit is seconds, and can be expressed as 30 seconds. The following are also possible values:

- 5 minutes
- 24 hours
- 3 days

The unit for the retry-delay value can also be expressed as a partial name, as follows:

- 30 s
- 30 sec
- 30 seconds

Note that all parameters to methods and callbacks that are marked with the @common:message-buffer annotation must be serializable; that is, they must implement java.io.Serializable. For an example, see Using Buffering to Create Asynchronous Methods and Callbacks.

## Controlling Retry Behavior

You may control retry behavior of buffered methods at runtime by using weblogic.jws.RetryException. See Controlling Retry Behavior in the topic Using Buffering to Create Asynchronous Methods and Callbacks.

Related Topics

Designing Asynchronous Interfaces

Using Buffering to Create Asynchronous Methods and Callbacks