Home Help Center

A question about IceGrid

rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
For example:
$more app.xml
<icegrid>
	<application name="Ripper">
		<replica-group id="EncoderAdapters">
			<object identity="EncoderFactory"
				type="::Ripper::MP3EncoderFactory"/>
		</replica-group>

		<server-template id="EncoderServerTemplate">
			<parameter name="index"/>
			<parameter name="exepath"
				default="/opt/ripper/bin/server"/>
			<server id="EncoderServer${index}"
				exe="${exepath}"
<!--				activation="on-demand">			-->
				<adapter name="EncoderAdapter"
					replica-group="EncoderAdapters"
					register-process="true"
					endpoints="tcp"/>
			</server>
		</server-template>

		<node name="Node1">
			<server-instance template="EncoderServerTemplate"
				index="1"/>
		</node>
		
		<node name="Node2">
			<server-instance template="EncoderServerTemplate"
				index="2"/>
		</node>
	
	</application>
</icegrid>
$ icegridadmin --Ice.Config=config
>>> application add "app.xml"
>>> application list
Ripper
>>> server start EncoderServer1


And suppose icegridregistry and icegridnode(node1/node2) have started as expected.

This is the client code:
Ice::ObjectPrx obj = communicator->stringToObject("EncoderFactory");

MyQuestion:
1)
At this time, only EncoderServer1 has started while EncoderServer2 has not. When the ice run time in the client sends the identifier "EncoderFactory" to the Locator(IceGrid), how many endpoints/proxies are returned to the client? One or two ?

2)
if we turn on the <activation="on-demand"> feature in app.xml, how many endpoints/proxies are returned to the client ?

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    rc_hz wrote:
    This is the client code:
    Ice::ObjectPrx obj = communicator->stringToObject("EncoderFactory");

    Note that this code transforms the stringified proxy into a proxy object, nothing more. For instance, this call won't cause the Ice runtime to contact the locator to get the indirect proxy endpoints. The Ice runtime will contact the locator to get the indirect proxy endpoints on the first remote call, for example if you ping the object:
    Ice::ObjectPrx obj = communicator->stringToObject("EncoderFactory");
    obj->ice_ping();
    
    MyQuestion:
    1)
    At this time, only EncoderServer1 has started while EncoderServer2 has not. When the ice run time in the client sends the identifier "EncoderFactory" to the Locator(IceGrid), how many endpoints/proxies are returned to the client? One or two ?

    Since EncoderServer2 can't be started on demand, the locator will return only the endpoint(s) of EncoderServer1.
    2)
    if we turn on the <activation="on-demand"> feature in app.xml, how many endpoints/proxies are returned to the client ?

    It should activate EncoderServer2 and return the endpoints of EncoderServer1 and EncoderServer2.

    Benoit.
Sign In or Register to comment.