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

Service Bus PEEK_LOCK option appears to be broken in 0.9.4 #1075

Closed
jhosteny opened this issue Sep 14, 2016 · 3 comments
Closed

Service Bus PEEK_LOCK option appears to be broken in 0.9.4 #1075

jhosteny opened this issue Sep 14, 2016 · 3 comments

Comments

@jhosteny
Copy link

I updated to service bus release 0.9.4 to address 985. However, I now am unable to successfully receive a message with the receive option set to PEEK_LOCK. Here is a code snippet:

    ReceiveMessageOptions opts = ReceiveMessageOptions.DEFAULT;
    opts.setReceiveMode(ReceiveMode.PEEK_LOCK);

    while (true) {
      try {

        BrokeredMessage brokeredMessage = this.fetchBrokeredMessage(opts);
        if (brokeredMessage == null) {
          break;
        }

        if (brokeredMessage.getMessageId() == null) {
            byte[] body = ByteStreams.toByteArray(brokeredMessage.getBody());
            String correlationId = brokeredMessage.getCorrelationId();
            LOGGER.error("BODY: " + body.toString());
            continue;
        }

With a newly created topic and subscription with no outstanding messages, this appears to start dequeuing a long sequence of brokered messages with no message ID, and some small sequence of bytes for the body. Here's sample output:

[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:38.654 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:38.739 level=ERROR logger=c.b.c.i.m.a.BaseAzureMessageReceiver message=BODY: [B@6d455f04
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:38.739 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:38.829 level=ERROR logger=c.b.c.i.m.a.BaseAzureMessageReceiver message=BODY: [B@1be2aea4
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:38.829 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:38.929 level=ERROR logger=c.b.c.i.m.a.BaseAzureMessageReceiver message=BODY: [B@26974151
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:38.929 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:39.023 level=ERROR logger=c.b.c.i.m.a.BaseAzureMessageReceiver message=BODY: [B@202bce11
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:39.024 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:39.123 level=ERROR logger=c.b.c.i.m.a.BaseAzureMessageReceiver message=BODY: [B@20c43c66
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:39.123 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:39.222 level=ERROR logger=c.b.c.i.m.a.BaseAzureMessageReceiver message=BODY: [B@5cb5ce8f
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:39.222 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:40.800 level=ERROR logger=c.b.c.i.m.a.BaseAzureMessageReceiver message=BODY: [B@558d4dcf
[host=MacBook-Pro-2.local ] [thread=AzureSubscriptionMessageReceiver RUNNING] timestamp=13:49:40.800 level=ERROR logger=c.b.c.i.m.a.AzureSubscriptionMessageReceiver message=TOPIC: staging-tenanteventenvelope, SUB: tenant-service-tenanteventenvelope

If a message is queued to the topic, it never is dequeued by this code. I never see the debug logging that shows the message, and it appears on the subscription as seen from the portal.

If I roll back the service bus dependency to 0.9.3, I am again able to successfully use PEEK_LOCK, but this causes other problems since jersey 1.13 has compatibility difficulties with Dropwizard.

This seems behavior consistent with another, older report in 644 that reports needing to roll back the jersey dependency in order to get PEEK_LOCK to work.

@bearrito
Copy link

Affected by this as well in similar environment.

@yvgopal
Copy link
Member

yvgopal commented Sep 29, 2016

Can you guys update to v0.9.5? The issue is fixed in the release.

@jianghaolu
Copy link
Contributor

Fixed in 0.9.5.

sima-zhu pushed a commit to sima-zhu/azure-sdk-for-java that referenced this issue Mar 21, 2019
* Corrected the documentation string for Credentials property

* Regenerated tests and samples
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants