Comments (6)
To the above code if I add the below:
SessionHandlerOptions sessionHandlerOptions = new SessionHandlerOptions(1, true, Duration.ofMinutes(5));
subscriptionClient.registerSessionHandler(new ISessionHandler() {...}, sessionHandlerOptions);
and change the return in onMessageAsync to the below:
return CompletableFuture.completedFuture(null);
Then I get the below errors. Some messages are received but I get the below errors and the program hangs:
2018-02-23 11:37:17,814 [24-7360c77df5c2] - ERROR RequestResponseLink - Opening internal send link of requestresponselink to sample-order-status/subscriptions/sample-hybris-order-status-subscription/$management failed.
com.microsoft.azure.servicebus.primitives.AuthorizationFailedException: Unauthorized access. 'Send' claim(s) are required to perform this operation. Resource: 'sb://ashokgoli.servicebus.windows.net/sample-order-status/subscriptions/sample-hybris-order-status-subscription/$management'. TrackingId:cbe7e9aa831a455abdaa17aacb814497_G27, SystemTracker:gateway6, Timestamp:2/23/2018 5:37:17 PM
at com.microsoft.azure.servicebus.primitives.ExceptionUtil.toException(ExceptionUtil.java:50)
at com.microsoft.azure.servicebus.primitives.RequestResponseLink$InternalSender.onClose(RequestResponseLink.java:743)
at com.microsoft.azure.servicebus.amqp.BaseLinkHandler.processOnClose(BaseLinkHandler.java:68)
at com.microsoft.azure.servicebus.amqp.BaseLinkHandler.onLinkRemoteClose(BaseLinkHandler.java:42)
at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:176)
at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:309)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
at com.microsoft.azure.servicebus.primitives.MessagingFactory$RunReactor.run(MessagingFactory.java:451)
at java.base/java.lang.Thread.run(Thread.java:844)
Resolved the above by adding Send claim to listen-only policy by following : Azure/azure-service-bus-java#110
and
2018-02-23 11:37:47,541 [nPool-worker-15] - ERROR RequestResponseLinkcache - Creating requestresponselink to 'sample-order-status/subscriptions/sample-hybris-order-status-subscription/$management' failed.
com.microsoft.azure.servicebus.primitives.TimeoutException: Open operation on RequestResponseLink(05a91c-RequestResponse) on Entity(sample-order-status/subscriptions/sample-hybris-order-status-subscription/$management) timed out at 2018-02-23T11:37:47.540528-06:00[America/Chicago].
at com.microsoft.azure.servicebus.primitives.RequestResponseLink$1.run(RequestResponseLink.java:77)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:299)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.base/java.lang.Thread.run(Thread.java:844)
from azure-docs-sdk-java.
Hi Ashok,
Do you see messages from all sessions getting processed.In my case if the max session is 1 only messages from 1 session is received. Rest of the session messages are not processed.
from azure-docs-sdk-java.
I have a similar issue. I am not able to mark the message as complete or abandon through session or SubscriptionClient.
from azure-docs-sdk-java.
if you are PeekLock mode return session.completeAsync(message.getLockToken())
@OverRide
public CompletableFuture onMessageAsync(IMessageSession session, IMessage message)
{
String messageString = new String(message.getBody(), StandardCharsets.UTF_8);
System.out.println("Received message:**** " + messageString);
return session.completeAsync(message.getLockToken());
}
Also for renewing the sessions use-
@OverRide
public CompletableFuture OnCloseSessionAsync(IMessageSession session)
{
return session.renewSessionLockAsync();
}
from azure-docs-sdk-java.
@ashok2ashok Is this still an issue for you? If not, I will close it by the end of next week.
from azure-docs-sdk-java.
Closing old issue with no follow up.
from azure-docs-sdk-java.
Related Issues (20)
- Generate Track 2 Management libraries locally and copy them over to reference docs website as short term solution HOT 1
- Root README Refers to Invalid Links/Paths
- Does not show UPLOAD of streamed file, but says it does HOT 1
- Missing supported client libriaries in azure identity "next steps" section
- Missing the read example
- Broken link HOT 3
- Cannot create mysql user sdk HOT 1
- Azure Communication Service - While creating ChatThreadClient, getting error 401
- "os" cannot be "Linux" but only "linux", but the example has it with capital L HOT 1
- Spring package clean up in docs repo HOT 1
- AzureServiceBusTopicAutoConfiguration should import AzureServiceBusAutoConfiguration HOT 1
- Picture links in READMEs are not changed into GitHub commit url
- Disable automatic pushing of ref docs to live
- Typo "Github"→"GitHub"
- Regarding the issue that message reception from partitions stops
- This repo is missing important files HOT 1
- JavaDoc for Storage HOT 3
- OWASP Dependency Checker flags issues on dependent libraries
- Docker hub links are broken
- Type in API method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-docs-sdk-java.