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

Dynamic Ice and Blobject (IceStorm)

I'm working on a publish/subscribe service similar to IceStorm, but distributed with delivery nodes on each machine which might have subscribers on it, such that any publishing operation generates a single event notification to each node, rather than one to each subscriber (replication to local subscribers is handled at the node level).....

I'm running into an issue with the publisher proxy... I gathered from the IceStorm source and docs that all I needed to do was derive from Blobject, create an ID, add it to an adapter, and cast the returned proxy to the desired interface.....

This isnt working.. I'm getting a proxy that doesnt type check with the target interface, and all interface methods fail with an "OperationNotExistException"

where did I miss ???


  • mes
    mes California

    Is ice_invoke being called on your Blobject subclass?

    To allow clients to perform a checkedCast on your Blobject, ice_invoke must recognize and respond to the "ice_isA" operation. It should also respond to "ice_ping", "ice_id" and "ice_ids".

    If you are still having trouble, the best way to get it resolved is to provide some sample code that demonstrates the problem. Please also specify your Ice, platform and compiler versions.

    Take care,
    - Mark
  • Ice 2.1.0

    and I'm using an unchecked cast just like the IceStorm samples in the manual

    I dont implement any of those operations.... is there a sample that has implementation that I can model on ??

    I didnt think they were necessary since it didnt appear that IceStorm was doing any of that
  • mes
    mes California
    IceStorm doesn't implement those operations because a topic's publisher object doesn't know the type it is representing. If your service works in a similar way, then there is no need for your Blobject to implement them either. However, if you do not implement support for ice_isA, then your clients cannot call checkedCast on proxies for your Blobject, they must only use uncheckedCast.

    - Mark
  • ok -- I'm returning a Publisher Proxy pretty much just like IceStorm does... and using unchecked cast to make it into a TargetPrx (the interface that I'm testing with is named Target)

    but when I single step the "callme" method on the casted blobject, it never gets to ice_invoke.... it blows on a type check someplace in _TargetDelD... which I infer is a direct delegate for a localally instanced object, rather than a remote delegate

    what step did I miss in getting from a "blobject proxy" to a "target proxy" ??

    or am I missing things completely ?? a publisher is supposed appear as the interface that will get called on the subscriber ?? correct ??

    I just looked... I dont see anything in the generated c# code that would handle casting a blobject, or handle routing method calls to blobject.ice_invoke

    now I'm really confused how a blobject works !!!
  • benoit
    benoit Rennes, France
    It sounds like you're invoking on a proxy which refers to a collocated object. Collocation optimization can't be used if the object is incarnated with a blobject servant. You will need to turn it off by calling ice_collocationOptimization(false) on the proxy.

    Hope this helps!

  • that nailed it -- Thanks !!
  • OK.. now on the other end of the system... trying to dispatch the event to subscribers... I'm getting collocation exceptions when I call ice_invoke on the subscriber proxy (again.. its a direct delegate).....

    if I ice_colo(false) on the proxy, the ice_invoke call kills the thread making the call rather than throwing an exception.. so I have zero clue as to whats going on in this case

    are there no debug dlls available for the C# interface so I can step into the code ??

    Ideas why its not dispatching the invocation to the subscriber ??