Show TOC Start of Content Area

Procedure documentation Creating a Message Selector  Locate the document in its SAP Library structure

Procedure

Creating a message selector

You define the criteria for message selection of a particular consumer, specifying conditions on the values of the message properties, and using the message selector expression.

This graphic is explained in the accompanying text

String selector;

selector = new String("(name = 'searched_string') OR (name = 'another_searched_string')");

Creating a message consumer with a selector

      When you use a Topic connection, the message consumer creation looks as follows:

This graphic is explained in the accompanying text

subscriber = topicSession.createSubscriber(topic, selector);

      When you use a Queue connection, the message consumer creation looks as follows:

This graphic is explained in the accompanying text

receiver = queueSession.createReceiver(queue, selector);

For more information about the message selector syntax, see Message Selector Syntax.

End of Content Area