Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help wanted: Peer Reconnection problem #154

Open
arifulislam2007 opened this issue Apr 20, 2020 · 3 comments
Open

Help wanted: Peer Reconnection problem #154

arifulislam2007 opened this issue Apr 20, 2020 · 3 comments

Comments

@arifulislam2007
Copy link

arifulislam2007 commented Apr 20, 2020

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:
<Configuration xmlns="http://www.jdiameter.org/jdiameter-server"> <LocalPeer> <!-- <URI value="aaa://10.240.25.141:1812"/> --> <URI value="aaa://azrc-ed-045:1812"/> <IPAddresses> <IPAddress value="10.240.25.141"/> </IPAddresses> <Realm value="chgwdev2.azerconnect.az"/> <VendorID value="10415" /> <ProductName value="jDiameter"/> <FirmwareRevision value="1"/> <OverloadMonitor> <Entry index="1" lowThreshold="0.5" highThreshold="0.6"> <ApplicationID> <VendorId value="10415"/> <AuthApplId value="4"/> <AcctApplId value="3"/> </ApplicationID> </Entry> </OverloadMonitor> </LocalPeer>

<Parameters> <AcceptUndefinedPeer value="false"/> <DuplicateProtection value="true"/> <DuplicateTimer value="240000"/> <UseUriAsFqdn value="false"/> <QueueSize value="10000"/> <MessageTimeOut value="60000"/> <StopTimeOut value="10000"/> <CeaTimeOut value="10000"/> <IacTimeOut value="30000"/> <DwaTimeOut value="10000"/> <DpaTimeOut value="5000"/> <RecTimeOut value="10000"/> <Concurrent> <Entity name="ThreadGroup" size="64"/> <Entity name="ProcessingMessageTimer" size="1"/> <Entity name="DuplicationMessageTimer" size="1"/> <Entity name="RedirectMessageTimer" size="1"/> <Entity name="PeerOverloadTimer" size="1"/> <Entity name="ConnectionTimer" size="1"/> <Entity name="StatisticTimer" size="1"/> </Concurrent> </Parameters>

<Network> <Peers> <Peer name="aaa://10.220.64.228:16553" attempt_connect="true" rating="1"/> </Peers> <Realms> <Realm name="www.cbpadpt451TestBed1.com" peers="10.220.64.228" local_action="LOCAL" dynamic="false" exp_time="1"> <ApplicationID> <VendorId value="10415"/> <AuthApplId value="4"/> <AcctApplId value="3"/> </ApplicationID> </Realm> <Realm name="www.cbpadpt451TestBed1.com" peers="10.220.64.228" local_action="LOCAL" dynamic="false" exp_time="1"> <ApplicationID> <VendorId value="0"/> <AuthApplId value="4"/> <AcctApplId value="0"/> </ApplicationID> </Realm> </Realms> </Network> <Extensions/> </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
Copy link

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
Copy link
Author

arifulislam2007 commented Jun 9, 2020

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants