It'd be nice to allow a component to logically subscribe to the output of a component to support 1-many distribution - i.e. like JMS topics.
Right now a component can output a one-way and not really care where it goes - letting the NMR do the routing. So we should provide a 'service subscription' model on a component to be able to do 1-many routing.
e.g.
each component's ActivationSpec could have a collection of Subscription objects, each subscription object could be something like...
class Subscription {
QName serviceName
QName interfaceName
QName operationName
String endpoint
Filter filter
}
Maybe we could include an SubscriptionBroadcaster interface so that you could implement both a parallel broadcaster and serial broadcaster.
And programatically maybe we should provide an interface to allow you to add a subscription from a JBI component/service.
This might be part of the ComponentContext, this might provide a simple method such as,
componentContext.registerSubscription(ServiceEndPoint serviceEndPoint)
A few questions:
- Are all subscriptions immutable?
- Do we provide the ability to add subscription query language like JMS subscription? An interesting question is mapping a JMS property to a NormalizedMessage property?
- Subscription persistence