Re: [jgroups-users] RPC request and response message prioritization
Questions/problems related to using JGroups <[email protected]>
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Mike
> Can I remove PRIO in master then?
> [ME] Yes
[bela] OK, done
>> The problem I have is prioritizing the RPC method response which, as you
>> can image, is where the large amounts of data needs to be transferred.
>> The problem is that the RequestCorrelator, after calling the
>> RpcDispatcher.handle method, creates the response messages with a fixed
>> set of headers and thus it has removed the PrioHeader that I added in
>> the rsp instance in RpcDispatcher.handle.
>
> Wait: handle() returns an Object not a Message so how can you add
> headers there?
> [ME] Handles argument is a Message
> @Override
> public Object handle( Message req) throws Exception {
> I add the PrioHeader to the req argument
[bela]
I don't understand: req is the request and should already have a
PrioHeader. What you'd need to add a header to is the returned Object
which is later wrapped in a message, wouldn't you?
> If you extended RequestCorrelator.sendReply() and set your subclass in
> RpcDispatcher, would that help? Or you could override sendResponse() or
> prepareResponse().
> [ME] Good Idea. I extended RpcDispatcher and RequestCorrelator and override the necessary methods (1 method in each class) and it worked fine. Thanks!
[bela]
I also added MessageDispatcher.correlator(RequestCorrelator c) to set
the RequestCorrelator
> Or would subclassing RequestCorrelator and setting it in RpcDispatcher
> work for you?
>
> [ME] --- As mentioned above, extending those two classes was perfect!
OK, great!
--
Bela Ban, JGroups lead (http://www.jgroups.org)
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape