Getting NPE When using NotificationListener

Hello
I am using the code snippet mentioned here. Getting NPE when I called

member.getJoined()

I checked member is not null. Not sure what's the error. Printing the stacktrace. First 3 lines are my logging statements

Queue id: 82c2f7e4-2ceb-4cab-ad43-3d81000a7cf6 Queue name: United Kingdom_[PHONE QUEUE ONLY] Driver Funnel_English_Normal
Event type: member left
Member id: e00513f3-9541-4198-9d9d-d4f4c0c53f9c Membeer name: {}
2021-07-21 17:29:11,420 ERROR com.mypurecloud.sdk.v2.extensions.notifications.NotificationHandler -
java.lang.NullPointerException
at com.uber.co.insights.faas.common.source.SalesforceAgentQueueChangesSource$QueueMemberEventListener.onEvent(SalesforceAgentQueueChangesSource.java:92)
at com.mypurecloud.sdk.v2.extensions.notifications.NotificationHandler$1.onTextMessage(NotificationHandler.java:135)
at com.neovisionaries.ws.client.ListenerManager.callOnTextMessage(ListenerManager.java:352)
at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:262)
at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:240)
at com.neovisionaries.ws.client.ReadingThread.handleTextFrame(ReadingThread.java:965)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:748)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:110)
at com.neovisionaries.ws.client.ReadingThread.run(ReadingThread.java:66)

Can you help ?

Hi Raj.

I will see if we can get someone on the developer engagement to take a look at this.

Thanks,
John Carnell
Manager, Developer Engagement

Hi Raj,

I've been looking into this problem.

It appears that there is a bug in the notification service and for every membership event, two messages are sent in quick succession. One contains the joined boolean, the other doesn't.
The resulting exception from calling member.getJoined() on the message without the joined boolean is handled by the notification handler and logged using the default logger. It can safely be ignored.

I have reported this issue to the relevant team and they will work to resolve it.

Thanks for reporting,
Ronan

Thank you @anon11147534 for the quick reply.

Let me know on this post when the fix has been deployed.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.