[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ecf-dev] ECF3.2 using Spring
|
Hi Scott
Today i tried with ECF generic server.But i found it not much flexible
For the following scenarios its failing
1.client start first and server start next.client remote calls to servers are failing
2.server start first,then client.Service calls from client to server successful(even restating of server osgi bundles from osgi console).But once i restart the server.client service calls are failing throwing connection exception
Please suggest me what provider to use?
Following is my project for which i was analyzing whether i can go with using ECF
"i have 4 machines running osgi ecf.1 machine is the master which basically does the load balancing and distribute the call to 3 other slave machines and combine the results received from the slave machines and respond to external systems.During processing in slave machines it needs few informations from the master machine which can be achieved by making a remote call to the master machine.
So basically i need a 2 way communication between 2 system running OSGI(master and slave). The master system has to handle 50000 packets per sec and distribute it to slave systems .(by making ecf remote service calls)."
Can i make multiple service call from one bundle.Do i need to create multiple client container.Can i avoid configuring port.Can the container creation be done by automatically from a port range instead of trying to create on a default port which may be in use?"
Thanks and Regards
Abhisek
On Sat, May 8, 2010 at 11:11 PM, abhisek saikia
<agscontact@xxxxxxxxx> wrote:
Hi Scott
Thanks a lot for your response
I have 3 osgi bundles Consumer bundle,Remote Interface Bundle(contain the raw remote interface) and RemoteService bundle(containing the implementation of remote interface)
consumer and remote interface bundle is running in client machine and RemoteService ,remote interface bundles running in server machine.
from consumer bundle i am making a remote service call ..which is sucessful .In both the side i am able to see proxy bundle geting created.
then i stopped the RemoteService bundle from osgi console(using command - stop 80(bundle no)) .I am able to see proxy bundles are geting removed from both the sides.(client and server machine's osgi).
Now i started the server bundle using command start 80(bundle no of RemoteService bundle).And a new proxy bundle gets created in both the side.But surprisingly when my consumer bundle failed to make the service call again.While debugging i found discovery is happening in client osgion restart of RemoteService bundle ....and reregistering is failing as the new modified service doesnt have service.uri which was being checked by FilterImpl class and failing to register the newly up bundle because of this.I am not sure whether this is the problem.I changed the ChannelEndpointImpl
old code
case LeaseUpdateMessage.SERVICE_MODIFIED: {
final Dictionary newProps = (Dictionary) suMsg.getPayload()[1];
final ServiceRegistration reg = (ServiceRegistration) proxiedServices
.get(serviceID);
if (reg != null) {
reg.setProperties(newProps);
}
final RemoteServiceReferenceImpl ref = getRemoteReference(getRemoteAddress()
.resolve("#" + serviceID).toString()); //$NON-NLS-1$
ref.setProperties(newProps);
RemoteOSGiServiceImpl
.notifyRemoteServiceListeners(new RemoteServiceEvent(
RemoteServiceEvent.MODIFIED, ref));
return null;
}
my changes:
case LeaseUpdateMessage.SERVICE_MODIFIED: {
final Dictionary newProps = (Dictionary) suMsg.getPayload()[1];
final ServiceRegistration reg = (ServiceRegistration) proxiedServices
.get(serviceID);
if (reg != null) {
reg.setProperties(newProps);
}
final RemoteServiceReferenceImpl ref = getRemoteReference(getRemoteAddress()
.resolve("#" + serviceID).toString()); //$NON-NLS-1$
///--------------------------------- newProps doesnt have service.uri --------------------------
String uri = getRemoteAddress().resolve("#" + serviceID);
newProps.put(RemoteOSGiService.SERVICE_URI, uri.toString());
ref.setProperties(newProps);
/////--------------------------------------code added ----------------------------------------------------
RemoteOSGiServiceImpl
.notifyRemoteServiceListeners(new RemoteServiceEvent(
RemoteServiceEvent.MODIFIED, ref));
return null;
}
After this changes sometimes service call became successful but sometimes its throwing Serialization exception .I am shocked how this change is impacting it...Please suggest how to go with fixing this problem
Thanks in advance
Ab
On Sat, May 8, 2010 at 7:13 PM, Scott Lewis
<slewis@xxxxxxxxxxxxx> wrote:
Hi Abhisek,
abhisek saikia wrote:
Hi all
I am using ecf3.2 and r-osgi as provider.I am able to inject the remote service through spring and able to estublish the remote call from client to server.But when i stop the server bundle and start it again,a new proxy is geting created with new fragment,but the service calls started failing.Any idea how to solve this?
A couple of questions to help understand what's going on here.
When you say 'stop the server bundle', what/which bundle(s) are you referring to? How do you stop this/these bundles? (e.g. console, via Spring, etc)?
I'm not familiar with the details of Spring's handling of unregistering services (remote or otherwise)...is there some way to have Spring call the remote service's ServiceRegistration.unregister() during server shutdown? Is it doing this?
On the proxy side...do both the old proxy and new proxy fail? Do they fail with the same/any exception? If it is generating an exception could you report that exception here? Thanksinadvance.
BTW, since 3.2 we've changed the proxy policy for automatic container creation (i.e. bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=303979) and this may make integration with Spring even easier...because no ECF-specific code is needed (even in the default case) to get container creation on the consumer/proxy. This will be in ECF 3.3/Helios.
Thanks,
Scott
_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev