Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] [Joynr 1.6.1] Register a new provider after the consumer has started #40

Open
andreisanta09 opened this issue Dec 7, 2018 · 2 comments

Comments

@andreisanta09
Copy link

Hi,

I'm trying to have a running consumer that would collect data from any new provider that would use a domain / interface combination known by the consumer.

I've build a consumer and a provider and I would want to register multiple provider instances (so using the same domain / interface) running on different machines / devices.
I've written a custom ArbitrationStrategyFunction that would return all the discovery entries for a given domain / interface combination.

Steps:

  • start 2 instances of the provider on 2 different machines (each provider with a different participantId)
  • start the consumer -> the custom arbitration strategy function will return both entries for the 2 providers and the consumer will start getting data from them
  • start a new instance of the provider - the consumer won't connect to this provider
  • restart the consumer -> the custom arbitration strategy function will return all 3 discovery entries
    for the providers and the consumer will start getting data from all of them

Is there a way for the consumer to subscribe to a provider registered by the Discovery service after the consumer started ? Can the Discovery service update the consumer on a new provider being available ?

Thanks,
Andrei

@ghost
Copy link

ghost commented Dec 10, 2018

Consumers know providers during the discovery step. Discovery runs during proxy creation and there is no way to trigger it afterwards. When you say "will start getting data from all of them", what are you referring to? multicasts, selective broadcasts or what exactly? Also the exchange of data might vary if for example the provider uses fixed-participant id in a shared-subscription settings...

@andreisanta09
Copy link
Author

Hi,

Sorry if I was not clear enough: I was referring to a multicast - the provider will broadcast data and the consumer will subscribe to that broadcast. Having multiple instances of the same provider will result in the consumer retrieving data from all of them via the subscription.

What I'm trying to achieve is to have a consumer that could subscribe to 'n' providers (where some of the providers could start after the consumer) and to be able to trigger a RPC back to all the providers.

I've also tried to use a fixed-participant ID.This will solve the problem of a provider starting after the consumer as all providers will use the same topic (fixedParticipantId/interface) to broadcast data.
However, in this case there seems to be a problem with the RPC (fire&forget) : a call won't reach all the providers all the time (sometimes only one provider will get the call, sometimes one provider will get the call once and another provider will get the call twice, sometimes only one provider will get the call multiple times). This isn't happening when the participant ID of each provider is unique (each provider gets the call once).

Thanks,
Andrei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant