Regarding dispacher

Posted by Admin on 14-May-2008 04:43

Hi

I am new for Sonic, i am developed one service that will send message to other service after completing initializing in init. for this i used XQDispacherImpl. Now i have to listen some input message from other services. i am not able to enter in service method. can anybody give help for this?

Message was edited by:

Raghavendra vvn

All Replies

Posted by dmillman on 15-May-2008 16:45

I am not sure what you are trying to do here, and probably the bigger question is why?

Typically the init method is only used to perform connections and other initializations, I have not seen it used for emitting a message. More to the point I have not seen a service that has been used to emit and to receive messages. It seems that you maybe trying to do too much in a service or there is some other way of getting the result that you require.

Please let us know so that we can help.


David

Posted by Admin on 20-May-2008 08:08

Thanks for ur reply.

My problem is I have to develop a service that service will have Entry and End point. Apart from this my service have to connect to other Endpoint i.e listen and post messages independent of service method. Because service context will initialize if and only if any message is coming to service.

so please help me.

Posted by dbenton99 on 20-May-2008 15:39

You need to follow the service lifecycle defined by the Sonic products. (i.e. init is called once, start and stop are called when the service is recycled, destroy is called when the service is done away with and service for handling messages) If you are trying to conserve some resource on the other side of the service, then I would suggest using lazy instantiation in you service method and only do the minimum setup required in your init method.

I am not sure I follow you on why you service would need to listen to an post messages outside of what is provided in the Entry and Exit endpoints.

Posted by Admin on 21-May-2008 01:03

Here i am attaching scenario.

My service will send some request to DB service through DB Topic and listen the response .This is my i/p 1. And my service listen some i/p from Entry topic.Based on i/p 1 and 2 i have to develop o/p to Exit topic.

How can i send request to DB service with out initialize my XQServiceContext object?

Because service will start only when some message will come and then only my XQServiceContext is initilize.

Message was edited by:

Raghu v

This thread is closed