3
votes

I have a node which is running on my machine along with a spring boot client. Client connects to node's rpc port, every thing works well but when i close my client the node crashes and i have to restart it. Why its happening is it a bug or i am doing some thing wrong. I have also deployed them on cloud and same problem happens.

 Corda Open Source 4.0 (503a2ff) May 16 11:37:43 broker java[16853]: Logs can be found in : /opt/corda/logs May 16 11:37:58 broker java[16853]: Advertised P2P messaging addresses : 35.228.97.4:10011 May 16 11:37:58 broker java[16853]: RPC connection address : 10.166.0.2:10012 May 16 11:37:58 broker java[16853]: RPC admin connection address : 10.166.0.2:10050 May 16 11:38:01 broker java[16853]: Loaded 2 CorDapp(s) : Contract CorDapp: Template CorDapp version 1 by vendor Corda Ope May 16 11:38:01 broker java[16853]: Node for "Broker" started up and registered in 19.86 sec May 16 11:38:01 broker java[16853]: SSH server listening on port : 2222 May 16 12:10:03 broker java[16853]: Shutting down ...
1

1 Answers

1
votes

It depends how you create your CordaRPCOps class.

If it is a bean, then it will call CordaRPCOps.shutdown when the client is shutdown. This is due to Spring triggering any method named shutdown on any beans by default. Therefore by not creating it as a bean, for example having a wrapper class around CordaRPCOps that is created as a bean instead will resolve this issue.

Or you can tell spring to not trigger the shutdown method by defining your bean like:

@Bean(destroyMethod = "")
public CordaRPCOps proxy() {}