Solved

JMS

Posted on 2002-03-07
2
378 Views
Last Modified: 2010-03-31
Hi all
I read in java.sun JMS tutorial that I can create a message selectors. Can I use it to select messages that contains/not contains specific words ?
If so How can I do it? (I need to moderate messages that contains specific words)
Code will be useful.
    Thanks Danny
0
Comment
Question by:dannysh
2 Comments
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 40 total points
ID: 6852233
According to the JMS Spec (3.8.1), selectors cannot reference message body values. Instead, they allow the consumer to specify which messages it is interested in based on headers and properties of the message. The header is a set of predefined fields needed primarily for routing and delivery. The properties are application defined but are separate from the body of the message itself. If you could be guaranteed that the producer of the message would reliably put the correct properties in the message so that your filtering would work, then you could use a selector in your message consumer. Note that the selector doesn't prevent a producer from placing a message on a queue. It simply prevents the consumer from seeing it. The following link, although some of it is Oracle specific, contains some example code for using a selector
    http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a88890/adq12jap4.htm

The JMS Specification itself contains a detailed explanation of the syntax for a selector. It is SQL-ish in nature so if you understand a SQL where clause you are well on your way to understanding the JMS selector syntax.

Best regards,
Jim Cakalic
0
 

Author Comment

by:dannysh
ID: 6855794
Thanks Jim.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
why cannot we forward request once the response is committed 2 46
java stored proc example 9 44
Running JavaFX on JDeveloper 12C 1 55
hashmap order 17 37
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question