azure-service-bus-java icon indicating copy to clipboard operation
azure-service-bus-java copied to clipboard

ServiceBusException while connecting from Android application

Open asbapat opened this issue 4 years ago • 4 comments

I am trying to subscribe to azure service bus from android application using Topic based subscription and SASAuthorizationToken. However I am getting the following exception:

W/System.err: com.microsoft.azure.servicebus.primitives.ServiceBusException: Error{condition=proton:io, description='null', info=null} at com.microsoft.azure.servicebus.primitives.ExceptionUtil.toException(ExceptionUtil.java:74) at com.microsoft.azure.servicebus.primitives.MessagingFactory.onConnectionError(MessagingFactory.java:414) at com.microsoft.azure.servicebus.amqp.ConnectionHandler.onTransportError(ConnectionHandler.java:170) at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:191) at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324) at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291) at com.microsoft.azure.servicebus.primitives.MessagingFactory$RunReactor.run(MessagingFactory.java:556) at java.lang.Thread.run(Thread.java:764)

Can you please what the exception is and why is it being thrown. Thank you..!!!

asbapat avatar Jun 19 '20 19:06 asbapat

@asbapat just a couple of thoughts to eliminate the SAS token as the issue. Can you try the same token with our C# SDK - we have many samples or use the RootManageSharedAccessKey?

vsaroopchand avatar Jul 01 '20 20:07 vsaroopchand

What is the connection string you are using? It looks like a failure to establish connection to service bus. Either 1. The connection string is wrong. Or 2. Something with the environment or network or firewall.

yvgopal avatar Jul 01 '20 20:07 yvgopal

Ultimately, this solution (SB SDK on Android) is not the most elegant way of getting notifications on the device. Have you considered the following options?

Logic Apps > Service Bus Connector > Email via O365 connector Logic Apps > Service Bus Connector > SMS Text Logic Apps > Service Bus Connector > Azure Function w/ Notification Hub bindings for Push Notification

These are all more elegant & use built-in capabilities on the devices.

vsaroopchand avatar Jul 02 '20 13:07 vsaroopchand

I have the same error message but it’s a java app running on azure container instance. I’ve tried using the same connection string with a dot net version of the app also running in ACI and it works just fine. The same java app runs fine locally and also on a normal azure VM.

I can’t figure this out - the logs don’t contain any hints as to what the problem is.

I have connected to the aci container running the java app and tried to telnet to service bus on the AMQP ports with no problems. It’s not a connectivity issue.

Andycharalambous avatar Sep 09 '20 03:09 Andycharalambous