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

Re: [xmlblaster] Message format

Hi Kai,

kai wrote:
> Hello everybody,
> yesterday evening I searched the net for some samples of how to define a
> message format in a MOM system. I'm afraid I only found links to SOAP
> and such specs. What would be the best way to use xmlBlaster messages
> efficient? At the moment I define a Message format where a sender can
> declare a command with its parameters. The result will be replied in the
> result tag of a command. As the result can be XML too I have to escape
> all XML characters with entities. I thought about placing the command
> identification and the parameters in the xmlBlaster key or qos part but
> I'm not sure if this is a good idea.

To put it in the key can only be done if the number of commands you use
are limited since the key is immutable for the topic (changing it in a
later message of the same topic will not have any effect). for such a
use case you could dedicate a topic for each command.

The other approach you suggested to put it in the message content is
also Ok. My personal favorite (since parsing is already included in the
client library for c++ and java) is to put it in the client properties
of the publish qos.

> As I want no p2p messaging I'm going to abuse the subscription method to
>  send the reply. Is this a good idea in matter of speed and network use?
I am not familiar with your use case but it seems you want to use the
MOM for a Request response pattern. Since you don't want p2p you want to
execute the command on an (to the sender unknown) number of clients.

I had a similar requirement which I solved by p2p for both request and
response, I know of others who have used a pub/sub for the request and a
p2p for the response. Both solutions (or even a pub/sub for both) make
sense depending of the details.

My question is which policy do you use for the acknowledge ?

- wait until first subscriber acknowledges the command
- wait until N subscribers have acknowledged the command
- other policy

I ask you this since xmlBlaster still lacks a generic request / response
pattern in its libraries (currently every user has to implement it his way).

Gathering this information is valuable since this issue of implementing
such a pattern is on the TODO list.

> Are there some samples how to define a good message format? Are there
> reference implementations that should be used? Any hint or link is welcome.

There are not but the content of the message could be anything you like.
Using a standard (either global like rpc or soap or specific to your
enterprise) would of course make sense.


> Regards, Kai