Archived

This forum has been archived. Please start a new discussion on GitHub.

Add more function to icegridregistry plugin more than filter

Hi, In my project, I want develop a service which will communicate with icegridregistry's query interface [FONT=Arial, sans-serif]frequently.
So, I want avoid the comm between service and registry, I wrote a demo plugin of registry, more than filter, the plugin implement things the general service do, such as create adapter、create well-known object, add object、activate adapter, and so on..., And the service call findallreplicas or findallobjectsbytype frequently can avoid network consume.

Questions:
1. Is the direction what I do have any problem?
2. Can I create
[/FONT]replica-group and [FONT=Arial, sans-serif]add adapter to it with code?

I found I can't do the question '2', So, I call addobjectbytype of admin interface, And call findallobjectsbytype in the plugin, but some problem occurs in the below scene:
Two Registry were setup, one master and one slave, So two plugin in them. The two plugin create a well-known object named "objTest" which also have type with name "objTest" too. And two adapter with different name created by two plugin.(when plugin initialize I can't create do all things because that the icegridregistry not start finish, so I done them in a timer thread with 5 seconds later, it's work well).

3. In the above scene, I call findallobjectsbytype of query interface in the plugin, I only got one proxy(in my mind, I should got two), why?
4. I install a typefilter in the plugin, but it's not be invoked, why?
5. If I stop one registry(I can't remeber which one), the plugin in the other registry can get the objTest proxy which is already down, and call it with error connectrefusedexception persistently in the timer thread .

All in one word, In the reqirement: "
[/FONT]communicate with icegridregistry's query interface [FONT=Arial, sans-serif]frequently", Is my direction is a correct direction? Any advise?[/FONT]

Comments

  • Can anyone help me? I'm waiting...~~~ If I am doing a stupid thing, Please tell me: You are wrong~ thanks
  • benoit
    benoit Rennes, France
    Hi,

    You can create a "dynamically registered" replica groups by setting the <adapter>.ReplicaGroupId and <adapter>.AdapterId properties for the object adapter you create. This requires the IceGrid registry to be ran with IceGrid.Registry.DynamicRegistration enabled. Also, note that Ice 3.5 and 3.6 suffers a bug where the replica group endpoints will fail to resolve if the replica group is registered with the 1.1 default encoding (to work-around this problem, you can set the <adapter>.Locator property to a 1.0 locator proxy).

    I suspect you only get a single object because you use the same object identity to register both objects. You should use different identities and the same type to register multiple Ice objects with the same type. In theory, the addObjectWithType call should fail with an IceGrid::ObjectExistsException if an object with the same identity is already registered, don't you get this exception on the second call?

    The type filter should be called when findAllObjectsByType is called.

    It's not clear what's not working exactly with your code but I don't see why what you're trying to do wouldn't work. Can you show us the code you're using to register the well-known objects and query the IceGrid registry? The best would be to send a small test case that demonstrates your issue.

    Cheers,
    Benoit.
  • Hi, benoit.
    Thank you very much first, Your answer solved my most problems, I will continue to do the plugin later, If there is some question, I will go back here to ask you ~ Thank you ! Thank you !