Glad you found these samples useful and yes the issue you are describing is very common in OSGi.
So here is what you can do:
On the publishing side you export service with extra properties that will allow you to uniquely identify it in the future:
Code:
<osgi:service id="inboundService" ref="inboundChannel"
interface="org.springframework.integration.channel.SubscribableChannel">
<osgi:service-properties>
<entry key="service.name" value="channelA" />
</osgi:service-properties>
</osgi:service>
And then on the receiving side (as you mentioned) you can filter via filter attribute of service reference:
Code:
<osgi:reference id="filesIn"
interface="org.springframework.integration.channel.SubscribableChannel"
filter="(&(service.name=channelA))"/>
Hope that helps