You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by FabioR <fa...@neogrid.com.br> on 2009/01/23 20:50:50 UTC

SubscriptionSpec Problem

Hi guys,

I built to components, one extending PollingEndpoint and one extending
ProviderEndpoint.
I'm running these components using the following configuration:

      <sm:activationSpec componentName="FILEComp" name="FILEComp"
endpoint="FILEReceiver5" service="neo:FILEReceiver5"
failIfNoDestinationEndpoint="false">
        <sm:component>
          <bc-file:FileComponent>
             <bc-file:endpoints>
                <bc-file:FILEReceiver endpoint="FILEReceiver5"
name="FILEReceiver5" service="neo:FILEReceiver5" period="10000"/>
             </bc-file:endpoints>
          </bc-file:FileComponent>
        </sm:component>
      </sm:activationSpec>

      <sm:activationSpec componentName="FILEComp1" name="FILEComp1"
endpoint="FILESender5" service="neo:FILESender5"
failIfNoDestinationEndpoint="false">
        <sm:component>
          <bc-file:FileComponent>
             <bc-file:endpoints>
                <bc-file:FILESender endpoint="FILESender5"
name="FILESender5" service="neo:FILESender5"/>
             </bc-file:endpoints>
          </bc-file:FileComponent>
        </sm:component>
        <sm:subscriptions>
          <sm:subscriptionSpec service="neo:FILEReceiver5"/>
        </sm:subscriptions>
      </sm:activationSpec>

In the receiver component I have this code:

	InOnly exchange = getExchangeFactory().createInOnlyExchange();
	NormalizedMessage in = exchange.createMessage();
	Utils.copyMessage(msg, in);
	exchange.setInMessage(in);
	this.send(exchange);

But the message is not sent to the FILESender5 component.

Trying to debug the code I arrived at:
SubscriptionManager.dispatchToSubscribers
SubscriptionManager.dispatchToSubscriber 
Registry.getMatchingSubscriptionEndpoints
SubscriptionRegistry.getMatchingSubscriptionEndpoints
SubscriptionSpec.matches 

At the SubscriptionSpec.matches method I found this line:
	ServiceEndpoint[] ses = registry.getEndpointsForService(service);

The service value is correctly set to FILEReceiver5, but this method try to
find internalEndpoints and the FILEReceiver5 is registered as
externalEndpoint, so no endpoints is returned and no message is sent to the
second component.
How I can solve this problem using subscription?

Thanks,
Fabio





-----
Fabio Retzlaff
-- 
View this message in context: http://www.nabble.com/SubscriptionSpec-Problem-tp21631463p21631463.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.