RestComm / jdiameter

RestComm Diameter Stack and Services
http://www.restcomm.com/
GNU Affero General Public License v3.0
112 stars 152 forks source link

Help wanted: Peer Reconnection problem #154

Open arifulislam2007 opened 4 years ago

arifulislam2007 commented 4 years ago

Hi, Sorry for duplicating the issue from Mobicents Public Forum on Google groups (https://groups.google.com/forum/#!topic/mobicents-public/1xdTZ-E_t34)

We're using jDimaeter for Event Charging Direct Debiting purpose. Recently we faced a strange problem - sometimes we have fluctuations in the network connectivity and Diameter server becomes unavailable and peer connection is lost. But even after the connectivity is restored, our diameter stack is not reconnecting automatically. We're continuously getting the exception "org.jdiameter.api.RouteException: Unable to find valid connection to peer" in our log file but Diameter server is reachable from the client server. Once we restart the application, the connectivity is restored and application starts working normally again.

Can anyone please suggest if this is a bug or some configuration mistake?

Below is my diameter configuration: `

` ` ` ` ` We found the following in logs: a.a.pgw.diameter.client.DiameterClient : Diameter: request error MessageImpl{commandCode=272, flags=128} error class RouteException Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: org.jdiameter.api.RouteException: Unable to find valid connection to peer[CBSService.com] in realm[www.cbpadpt451.com] Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.jdiameter.client.impl.router.RouterImpl.getPeer(RouterImpl.java:431) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.jdiameter.client.impl.controller.PeerTableImpl.sendMessage(PeerTableImpl.java:176) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.jdiameter.client.impl.StackImpl.sendMessage(StackImpl.java:428) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.jdiameter.client.impl.BaseSessionImpl.genericSend(BaseSessionImpl.java:121) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.jdiameter.client.impl.BaseSessionImpl.genericSend(BaseSessionImpl.java:88) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.jdiameter.client.impl.SessionImpl.send(SessionImpl.java:60) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.diameter.client.DiameterClient.sendRequest(DiameterClient.java:142) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.diameter.client.DiameterClient.sendRequest(DiameterClient.java:123) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.diameter.client.DiameterClient.topUp(DiameterClient.java:103) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.diameter.service.impl.DiameterServiceImpl.topUpAsync(DiameterServiceImpl.java:50) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.diameter.service.impl.DiameterServiceImpl.topUp(DiameterServiceImpl.java:57) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.core.service.impl.TopupByMsisdnServiceImpl.topupByMsisdn(TopupByMsisdnServiceImpl.java:95) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.core.service.impl.TopupByMsisdnServiceImpl$$FastClassBySpringCGLIB$$4677c347.invoke() Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.tps.aop.RateLimiterAspect.checkEsbRate(RateLimiterAspect.java:39) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at java.lang.reflect.Method.invoke(Method.java:498) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) Mar 12 18:01:39 pgw-bkc-app02 bkcpgwbank: at az.azerconnect.pgw.core.service.impl.TopupByMsisdnServiceImpl$$EnhancerBySpringCGLIB$$5fe2ccd1.topupByMsisdn() Any help would be really appreciated. Regards, Arif
stevedwyer-nasstar commented 4 years ago

Hi,

I can't see peer[CBSService.com] or realm[www.cbpadpt451.com] anywhere in your jdiameter configuration, so find it hard to believe that you can send any messages with this destination host or realm.

Any destination realm that you submit a request for into the jdiameter stack needs to be defined in the Network section of the jdiameter config.

By the way, you shouldn't need to populate the destination host prior to submission, as jdiameter will route messages to an appropriate host for the destination realm, based on your config.

Hope this helps.

arifulislam2007 commented 4 years ago

Hi Steve, Thank you very much for your reply. Sorry for missing that information, we defined that in another config file and were using them. So we'll remove the destination host from there and will use only the destination Realm. Let's hope this will solve the problem.

But I din't understand one point, how the initial connection is established with this configuration? It is working and we faced problem only in case of re-connection.

We developed a basic client based on the example client available on https://github.com/RestComm/jdiameter/blob/master/examples/guide1/src/main/java/org/example/client/ExampleClient.java

Regards.

AdnanMunir commented 4 years ago

Hi @arifulislam2007 ,

i am facing the problem of connecting to diameter server as from the start i get this error :

org.jdiameter.api.RouteException: Unable to find valid connection to peer[aaa://15.185.219.107:3868] in realm[cgrates.org]

my cgrates server is on this instance 15.185.219.107 and diameter agent is running on 127.0.0.1:3868

i am attaching the files can you please point out what i am missing ?

diam.zip