You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by Lloyd Smith <sm...@san.rr.com> on 2007/04/20 10:27:20 UTC

Bulk subscription

Our WSDM services will be managing quite a few objects - probably over a thousand.  It looks like the subscribe request has to be a web service call addressed to each managed object, which means that at consumer startup we're looking at (worst case) one thousand service calls.  Before I implement some kind of custom capability on the web service itself (taking a list of EPR's and a consumer, and returning a list of subscription EPR's), I wanted to check that I'm not missing anything obvious here.  Thanks in advance.

Re: Bulk subscription

Posted by Daniel Jemiolo <da...@us.ibm.com>.
WSN doesn't describe any way to do bulk subscription, not even in 
BrokeredNotification (with Brokered, you'd still have to tell the broker 
about all of the consumers so it could send out the messages it received). 
So yes, a custom capability would probably be necessary - just create a 
copy of Subscribe that allows for more than one ConsumerEPR, and then use 
code like this (error checking removed for brevity):


SubscriptionClient[] subscribe(EndpointReference[] consumers, Filter[] 
filters)
{
        NotificationProducer wsn = 
getResource().getCapability(WsnConstants.PRODUCER_URI);

        SubscriptionClient[] subscriptions = new 
SubscriptionClient[consumers.length];

        for (int n = 0; n < consumers.length; ++n)
                subscriptions[n] = wsn.subscribe(consumers[n], 
filters[n]);

        return subscriptions;
}



"Lloyd Smith" <sm...@san.rr.com> wrote on 04/20/2007 04:27:20 AM:

> Our WSDM services will be managing quite a few objects - probably over a 

> thousand.  It looks like the subscribe request has to be a web service 
call 
> addressed to each managed object, which means that at consumer startup 
we're 
> looking at (worst case) one thousand service calls.  Before I implement 
some 
> kind of custom capability on the web service itself (taking a list of 
EPR's 
> and a consumer, and returning a list of subscription EPR's), I wanted to 
check
> that I'm not missing anything obvious here.  Thanks in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org