[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xmBlaster vs CORBA Events clarification



Here is some more information about the problem I am seeing:

The publishing clients sends the following messages to the queue:

String[] saXmlKey = new String[5]; String[] saContent = new String[5];

  //Five different messages
  saXmlKey[0] = "<?xml version='1.0' encoding='ISO-8859-1' ?>\n" +
                        "<key oid='' contentMime='text/xml'>\n" +
                        "<AGENT id='message_1' subId='1' type='generic'>" +
                        "<DRIVER id='FileProof' pollingFreq='10'>" +
                        "</DRIVER>"+
                        "</AGENT>" +
                        "</key>";
  saContent[0] = "Content: message_1";

.... Four other messages are created using the same key and content except message becomes "message_2," "message_3,".. etc.

The publishing client loops through each of the messages and submits them to the queue. This process is repeated ten times and then the publishing client stops.

The subscribing client subscribes using an XPath query as follows:

        xmlKey = "<?xml version='1.0' encoding='ISO-8859-1' ?>\n" +
                          "<key oid='' queryType='XPATH'>\n" +
                          " /xmlBlaster/key/AGENT[ at id='message_3']" +
                          "</key>";
        try
                                {
           Log.trace(ME, "Subscribe to //AGENT[ at id='message_3']");
           xmlBlaster.subscribe(xmlKey, qos);
        }

     .....

The subscribing client outputs the receiving message via the update() method as follows:

public void update(String loginName, UpdateKey updateKey, byte[] content, UpdateQoS updateQoS)
{
Log.info(ME, "Receiving updateKey [" + updateKey.getUniqueKey() + "]");
Log.info(ME, "Receiving message [" + (new String(content)) + "]");
}



When the publishing and subscribing clients are run simulataneously it appears that the subscribing client is receiving all messages instead of the selected "message_3" message. Here is a sample of my output:


...Receiving updateKey [ .....]
...Receiving message [Content: message_1]


...Receiving updateKey [ .....] ...Receiving message [Content: message_2]


...Receiving updateKey [ .....] ...Receiving message [Content: message_3]


...Receiving updateKey [ .....] ...Receiving message [Content: message_4]


...Receiving updateKey [ .....] ...Receiving message [Content: message_5]


If I run the publishing client and then start the subscribing client after it is finished, the subscribing client produces the following output (which is what I expected in both cases):



...Receiving updateKey [ .....] ...Receiving message [Content: message_3]

...Receiving updateKey [ .....]
...Receiving message [Content: message_3]

... Repeated 10 times for each time the publishing client submitted the set of messages to the queue.


As I explained previously, I am new to xmlBlaster and XPATH stuff. I think my code is right, but it may be wrong. Please let me know if you see anything wrong with my XPATH query. I haven't had time to look at the xmlBlaster code to see if there is a contention problem with simulataneously publishing and subscribing to messages.


Thanks in advance for your help.


Brett

>
> 2. I have two small Java clients programs that publish and subscribe
> respectfully. The publishing client submits 5 different messages to the
> queue, and the subscribing client listens to just one of these messages
> using an XPATH query. The publishing client continually runs in a loop
> submiting the 5 messages synchronously. When both programs are running
> simultaneously the subscribing client gets all of the other messages even
> though he is only listening to one type.
Is your XPath query correct?
Otherwise it would be a bug in xmlBlaster.
Please send us informations (your publish key and XPath subscription)
to check it.


> If I stop the publishing client
> and start the subscribing client, the subscribing client gets the correct
> message that has been sent.
>
> Does anyone know why this would happen?
>


regards,

Marcel

--
Marcel Ruff
ruff at swand.lake.de
http://www.lake.de/home/lake/swand/
http://www.xmlBlaster.org
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com