GithubHelp home page GithubHelp logo

azure / azure-service-bus-java Goto Github PK

View Code? Open in Web Editor NEW
58.0 39.0 57.0 1.53 MB

☁️ Java client library for Azure Service Bus

Home Page: https://azure.microsoft.com/services/service-bus

License: MIT License

Java 100.00%
azure service-bus servicebus amqp messaging java

azure-service-bus-java's Introduction

Microsoft Azure Service Bus

Build/Package Status
master Maven Central

Moved

All new work on SDK is happening in the repository https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/servicebus. This repository is only to address any issues found in versions 1.2.x. And master1.0 is the branch corresponding to versions 1.2.x. Both dev and master branches moved to the new repository.

Microsoft Azure Service Bus Client for Java

This is the next generation Service Bus Java client library that focuses on Queues & Topics. If you are looking for Event Hubs, follow this link.

Azure Service Bus is an asynchronous messaging cloud platform that enables you to send messages between decoupled systems. Microsoft offers this feature as a service, which means that you do not need to host any of your own hardware in order to use it.

Refer to azure.com to learn more about Service Bus. And package can be downloaded from Maven

How to provide feedback

See our Contribution Guidelines.

Known issues

FAQ

Where is the API document?

Click here.

Where can I find examples that use this library?

The samples are located in this repo. Java Samples.

Can I manage Service Bus entities with this library?

Only rules management of subscription will be supported in this client library. This library focuses on Azure Service Bus Data Plane functionalities (e.g. send, receive).

The standard way to manage Azure resources is by using Azure Resource Manager. In order to use functionality that previously existed in the azure-servicebus Java library, this is Azure Service Bus Management Library which is available on Maven. And this is the API document. This management library will enable use cases that dynamically create/read/update/delete resources.

azure-service-bus-java's People

Contributors

banisadr avatar binzywu avatar christianwolf42 avatar clemensv avatar jtaubensee avatar makam avatar microsoft-github-policy-service[bot] avatar nemakam avatar yvgopal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-service-bus-java's Issues

Event Hubs package name clash

Hi am getting this error saying that.

java.lang.SecurityException: class "com.microsoft.azure.servicebus.SharedAccessSignatureTokenProvider"'s signer information does not match signer information of other classes in the same package
	at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)

When I try to push the topics from the regular program it is working good.
When am trying to send the topics from the eventhub using spark.

or if I use this repository and write a simple program to push the topic it is giving me an error saying that.

Exception in thread "main" java.lang.SecurityException: class "com.microsoft.azure.servicebus.MessageSender"'s signer information does not match signer information of other classes in the same package
	at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
	at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at com.microsoft.azure.servicebus.ClientFactory.createMessageSenderFromConnectionStringBuilderAsync(ClientFactory.java:38)
	at com.microsoft.azure.servicebus.ClientFactory.createMessageSenderFromConnectionStringAsync(ClientFactory.java:32)
	at com.microsoft.azure.servicebus.ClientFactory.createMessageSenderFromConnectionString(ClientFactory.java:16)
	at com.microsoft.azure.servicebus.TopicClient.<init>(TopicClient.java:24)
	at com.microsoft.spark.streaming.examples.workloads.EventProcessorTest.main(EventProcessorTest.java:32)

Thank You for your help.

Invalid byte tag in constant pool: 19

Actual Behavior

  1. I am getting the following org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19 when I Maven compile my library which uses: Service Bus 1.0.0-PREVIEW-3, AspectJ and the Jcabi Maven Plugin.
  2. When the same library is compiled using Service Bus 1.0.0-PREVIEW-2, the expected behavior is observed.

mvn install log.txt

Expected Behavior

  1. A successful compilation with no failures.

Versions

  • OS platform and version: Linux ubuntu 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Maven package version or commit ID: 1.0.0-PREVIEW-3

Message Id

The send function in MessageSender class has a void return type.
Could a message Id be returned as a response to the send function ?

I know we can set our own message Id value before sending , but an acknowledgement containing message Id for the sent message would be more convenient.

While receiving a message , we are getting a message ID even if we did not set it explicitly while sending. This means that an Id is generated for every message which is sent. So why cant this id be sent as a response to send function ?

SQS and Storage Queue does return a message ID as response to send message functions.

Schedule Message

While running the testSendSceduledMessageAndReceive() function in TestCommons.java file ->

The expected behavior is that the receiver should not receive the messages which has been scheduled, if the sleep time is less than the time we specified to wait before sending the message.

But , I am receiving the messages in this case.
I am receiving the messages even if I comment out the Thread.sleep line.

Could you please brief me about the working of scheduleMessage API.

Does the client defers sending the message till the scheduled time or the message is sent immediately but made hidden in the queue for the scheduled time ?

I am looking for a functionality similar to DelaySeconds in SQS (Reference -> http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html ).

Completing message

I wanted to explain two particular scenarios in the case of completing a message in Azure Service Bus Queues.

  1. Say we are using MessageReceivers to receive a message and not automatically renewing the lock .

A message can be completed only within the lock timeout period.

Now , if our clients need more time to process the message (More than the lock timeout period) , its completion call will not succeed and the message will again become visible on the queue for other receivers.

If all the clients who receive this message take more time than the timeout period , none of the complete calls will work. Hence , the message will always be there on the queue , till its moved to dead letter queue.

In SQS , if we have a valid receipt handle for a message , the receiver can delete it from the queue even if its visible to other receivers provided any other receiver has not yet received that message.
For reference -> http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html

Can we complete a message in Service Bus even after its lock period has expired (Assuming no other receiver has received that message) ?

Both SQS and Storage Queue provide this operation. Any reason or use case for which Service Bus behaves differently in this matter ?

Note – I know that this scenario arises only when we don’t use QueueClient which provides automatic lock renewal. But for reasons mentioned in the previous mails , we will not be able to use QueueClient and have to rely on MEssageReceiver (which doesn’t renew the lock ).

What is the maximum time till which I can continue to renew lock of a particular message ?

SubscriptionClient.registerMessageHandler for a Topic returns amqp:not-found error

Actual Behavior

Create a new SubscriptionClient object with ReceiveMode.PeekLock mode and use the following connection string.

Endpoint=sb://<service-bus-name>.servicebus.windows.net/;EntityPath=<topic-name>/<subscription-name>;SharedAccessKeyName=<key_name>;SharedAccessKey=<key>

The SubscriptionClient object gets created correctly. However, when registerMessageHandler is called on the object the following error is received.

Error:

Error{condition=amqp:not-found, description='Entity '<service-bus-name>:topic:<topic-name>~15/<subscription-name>' was not found. Reference:<reference-id>, TrackingId:<tracking-id> SystemTracker:<service-bus-name>:topic:<topic-name>~15/<subscription-name>|<tracking-id>, Timestamp:4/12/2017 2:36:16 PM TrackingId:<tracking-id>, SystemTracker:gateway6, Timestamp:4/12/2017 2:36:17 PM', info=null}

Expected Behavior

Expected to successfully create the SubscriptionClient object in the correct mode and start receiving messages.

Versions

  • OS platform and version: Fedora Linux 23
  • Maven package version or commit ID: azure-servicebus-1.0.0-PREVIEW.jar

SessionHandler dies when starts with many messages in queue

Actual Behavior

  1. Send 3 messages for 20 session, total 60
  2. Start SessionHandler using 10 concurrent sessions

private static final int CONCURRENT_SESSIONS = 10;
private static final int CONCURRENT_CALLS_PER_SESSION = 1;
private static final int RENEW_TIME_MINUTES = 2;
queueClient.registerSessionHandler(new ISessionHandler(){
...
}, new SessionHandlerOptions(CONCURRENT_SESSIONS, CONCURRENT_CALLS_PER_SESSION, false, Duration.ofMinutes(RENEW_TIME_MINUTES)));

  1. Session Handler processes several (not all) messages, displays warnings and completely dies - never closes open sessions and accepts new ones.
    Output:
    sessionhandler

Expected Behavior

  1. Processes all messages

It looks like the failure happens when CONCURRENT_SESSIONS is greater than number of CPU cores.
My laptop has 8 cores CPU.
Setting CONCURRENT_SESSIONS=8 works ok
with CONCURRENT_SESSIONS=9 it fails

Versions

  • OS platform and version: Windows 7 64-bit
  • Maven package version or commit ID: azure-servicebus-1.0.0-PREVIEW.jar

Manage permissions required to send/receive

Steps to reproduce:

  1. A MessagingFactory is created using a connection string with a shared access key from a policy that does not have the "Manage" claim.
  2. ClientFactory.createMessageSenderFromEntityPath() is called with the above messaging factory.
  3. The create sender times out. The error indicates that it is looking for $management.
  4. The same thing occurs for ClientFactory.createMessageReceiverFromEntityPath().

Stack trace:

Mar 03, 2017 5:28:59 PM com.microsoft.azure.servicebus.primitives.RequestResponseLink$1 run
WARNING: Open operation on RequestResponseLink(1c6214-RequestResponse) on Entity(testqueue/$management) timed out at 2017-03-03T17:28:59.850-08:00[America/Vancouver].
com.microsoft.azure.servicebus.primitives.TimeoutException: Open operation on RequestResponseLink(1c6214-RequestResponse) on Entity(testqueue/$management) timed out at 2017-03-03T17:28:59.850-08:00[America/Vancouver].
	at com.microsoft.azure.servicebus.primitives.RequestResponseLink$1.run(RequestResponseLink.java:72)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

SubscriptionClient throws AmqpException when adding RuleDescription

Attempting to add a rule description (filter) to a subscription client throws AmqpException regardless of existence of message on the subscription or not

Code snippet:
...
subscriptionClient.removeRule("$Default");
RuleDescription highRule = new RuleDescription("HighValueFilter", new SqlFilter(VALUE_KEY + " >= 5"));
subscriptionClient.addRule(highRule);
...

Exception thrown:

Exception in thread "main" com.microsoft.azure.servicebus.primitives.ServiceBusException: com.microsoft.azure.servicebus.amqp.AmqpException: The service was unable to process the request; please retry the operation. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 Reference:88473909-1a1d-4b26-8837-4ccb448362f0, TrackingId:09b28be8-262f-4a9c-9f90-471786393cba_B27, SystemTracker:ddiazbus:Topic:testtopic|testsubscription-highest, Timestamp:7/19/2017 6:37:19 PM
at com.microsoft.azure.servicebus.primitives.ExceptionUtil.toException(ExceptionUtil.java:58)
at com.microsoft.azure.servicebus.primitives.RequestResponseUtils.generateExceptionFromError(RequestResponseUtils.java:85)
at com.microsoft.azure.servicebus.primitives.RequestResponseUtils.genereateExceptionFromResponse(RequestResponseUtils.java:80)
at com.microsoft.azure.servicebus.primitives.MiscRequestResponseOperationHandler.lambda$null$8(MiscRequestResponseOperationHandler.java:231)
at com.microsoft.azure.servicebus.primitives.MiscRequestResponseOperationHandler$$Lambda$39/695361487.apply(Unknown Source)
at java.util.concurrent.CompletableFuture$AsyncCompose.exec(CompletableFuture.java:604)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:902)
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1689)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1644)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.microsoft.azure.servicebus.amqp.AmqpException: The service was unable to process the request; please retry the operation. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 Reference:88473909-1a1d-4b26-8837-4ccb448362f0, TrackingId:09b28be8-262f-4a9c-9f90-471786393cba_B27, SystemTracker:testBus:Topic:testtopic|testsubscription, Timestamp:7/19/2017 6:37:19 PM
... 11 more

Versions

OSX and CentOS
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

  • Maven package version:
    compile group: 'com.microsoft.azure', name: 'azure-servicebus', version: '1.0.0-PREVIEW-3'

Error AmqpControlProtocolClient.IdleTimerExpired occurred and message handler is not invoked any more.

Actual Behavior

Trying to understand this error, that occurred while reading from queue (name - 'dv-msg-processor-input'). After this error, there are no more messages delivered to the Message handler (IMessageHandler::onMessageAsync ). Is there any idle timeout error handling needed in the message handler?

2017-07-16 06:52:02,432 [Thread-74] DEBUG c.m.a.s.p.CoreMessageReceiver - Updating message state of delivery '??Zf6G?�?? +?' to 'Accepted{}'
2017-07-16 06:52:02,461 [Thread-74] DEBUG c.m.a.s.a.ReceiveLinkHandler - onDelivery: linkName:a811aa_7c153e52168e41498de34633c939a4d5_G41, updatedLinkCredit:90, remoteCredit:90, remoteCondition:Error{condition=null, description='null', info=null}, delivery.isPartial:false
2017-07-16 06:52:02,461 [Thread-74] DEBUG c.m.a.s.p.CoreMessageReceiver - Received a delivery '??Zf6G?�?? +?' from 'dv-msg-processor-input'
2017-07-16 06:52:02,461 [Thread-74] DEBUG c.m.a.s.p.CoreMessageReceiver - Received a delivery '??Zf6G?�?? +?' with state 'Accepted{}' from 'dv-msg-processor-input'
2017-07-16 06:52:02,461 [Thread-74] DEBUG c.m.a.s.p.CoreMessageReceiver - Completing a pending updateState operation for delivery '??Zf6G?�?? +?' from 'dv-msg-processor-input'
2017-07-16 06:52:02,461 [Thread-3303] DEBUG c.m.a.s.p.CoreMessageReceiver - Receiving maximum of '1' messages from 'dv-msg-processor-input'
2017-07-16 06:52:02,476 [Thread-74] DEBUG c.m.a.s.p.CoreMessageReceiver - There are no prefetched messages. Waiting for messages from 'dv-msg-processor-input'
2017-07-16 06:52:06,352 [Thread-74] DEBUG c.m.a.s.a.BaseLinkHandler - link remote close. linkName:fafc93_7c153e52168e41498de34633c939a4d5_G41
2017-07-16 06:52:06,352 [Thread-74] DEBUG c.m.a.s.a.BaseLinkHandler - linkName:fafc93_7c153e52168e41498de34633c939a4d5_G41, ErrorCondition:amqp:link:detach-forced, The link 'G41:13519094:fafc93_7c153e52168e41498de34633c939a4d5_G41' is force detached by the broker due to errors occurred in consumer(link22680). Detach origin: AmqpControlProtocolClient.IdleTimerExpired: Idle timeout: 00:10:00. TrackingId:57371acd-191c-45ca-9171-0cf6a4e57fec_B10, SystemTracker:evolvedev-ns:Queue:dv-msg-processor-input, Timestamp:7/16/2017 10:52:05 AM
2017-07-16 06:52:06,477 [Thread-74] ERROR c.m.a.s.p.RequestResponseLink - Connection error in request response link
com.microsoft.azure.servicebus.primitives.ServiceBusException: com.microsoft.azure.servicebus.amqp.AmqpException: The link 'G41:13519094:fafc93_7c153e52168e41498de34633c939a4d5_G41' is force detached by the broker due to errors occurred in consumer(link22680). Detach origin: AmqpControlProtocolClient.IdleTimerExpired: Idle timeout: 00:10:00. TrackingId:57371acd-191c-45ca-9171-0cf6a4e57fec_B10, SystemTracker:evolvedev-ns:Queue:dv-msg-processor-input, Timestamp:7/16/2017 10:52:05 AM
at com.microsoft.azure.servicebus.primitives.ExceptionUtil.toException(ExceptionUtil.java:86)
at com.microsoft.azure.servicebus.primitives.RequestResponseLink$InternalSender.onClose(RequestResponseLink.java:645)
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:426)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.microsoft.azure.servicebus.amqp.AmqpException: The link 'G41:13519094:fafc93_7c153e52168e41498de34633c939a4d5_G41' is force detached by the broker due to errors occurred in consumer(link22680). Detach origin: AmqpControlProtocolClient.IdleTimerExpired: Idle timeout: 00:10:00. TrackingId:57371acd-191c-45ca-9171-0cf6a4e57fec_B10, SystemTracker:evolvedev-ns:Queue:dv-msg-processor-input, Timestamp:7/16/2017 10:52:05 AM
... 10 common frames omitted
2017-07-16 06:52:06,477 [Thread-74] WARN c.m.a.s.p.RequestResponseLink - Completing all pending requests with exception in request response link to dv-msg-processor-input/$management
2017-07-16 06:52:06,477 [Thread-74] INFO c.m.a.s.p.RequestResponseLink - RequestResponseLink - recreating internal send and receive links to {}dv-msg-processor-input/$management
2017-07-16 06:52:08,999 [pool-2-thread-3] WARN c.m.a.s.p.CoreMessageReceiver - No messages received from 'dv-msg-processor-input'. Pending receive request timed out. Returning null to the client.

Expected Behavior

No error

Versions

  • OS platform and version: Azure App Service - with Apache Tomcat 8.0
  • Maven package version or commit ID: 1.0.0-PREVIEW-3

Configuring ports

Is it possible to configure the ports used by this SDK from the default ones of 5671 and 5672 ?

Queue Metadata

This issue is also related to the version 0.9.0 of the client which provides management operation.

Azure Storage Queue provides support store custom Queue Metadata as Key Value pairs ,

In Service Bus , the com.microsoft.windowsazure.services.servicebus.models.QueueInfo (QueueInfo) class , provides an API setUserMetadata .

But this accepts only a String as a parameter.
Am I supposed to send the attributes as a json String ?

Wont it overwrite earlier metadata value ?

The ideal way to store user metadata on the queue should be sending key value pairs.
Will any such support provided ?

This link -> [https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted#management-and-operations] says that Arbitrary metadata support is not supported by Azure Service Bus.

Could you please clarify ?

azure-service-bus-java conflicts with azure-event-hubs-java

Actual Behavior

I'm connecting to both eventhub and service bus using storm. I've been rolling my own amqp client but thought that using the azure sdk might be better for maintenance.

However, when using following versions

  1. Use azure-service-bus-java with version 1.0.0-PREVIEW-1
  2. Use azure-event-hubs-java with version 0.14.0

following method in MessageReceiver class will throw an Java.NoSuchMethod error during execution:

public static CompletableFuture createMessageReceiverFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, ReceiveMode receiveMode) {
Utils.assertNonNull("messagingFactory", messagingFactory);
MessageReceiver receiver = new MessageReceiver(messagingFactory, entityPath, receiveMode);
return receiver.initializeAsync().thenApply((v) -> receiver);
}

This is due to conflicts with the MessageReceiver class present in both the azure-event-hubs-java and azure-service-bus-java classes both in the com.microsoft.azure.servicebus package.

Will the two libraries eventually be synchronized to work together? If yes, is there an ETA? Moving forward though, what would be the best course of action? I've renamed and repackaged the two libraries to make it work in one storm topology but the maintainability of this is just as bad as my own spouts written in qpid.

Queue Attributes

I am using the old client for Service Bus ( Version - 0.9.0 ) along with this AMQP one to support both management and messaging operations in my application.

This issue is related to queue metadata support provided by the 0.9.0 version of the SDK.

SQS provides support to change few queue attributes after the creation of queue .

Specifically , I am looking for these 3 attributes ->

  1. Max Message Size
  2. Server Wait Time
  3. Lock Duration of message

The com.microsoft.windowsazure.services.servicebus.models.QueueInfo (QueueInfo) class provides support to change lock duration of a message (setLockDuration() method call).

I can use this API to change the lock duration attribute for the queue even after the queue has been created.

What I am looking for are similar support to change the other two queue attributes ( Max Message Size and Server Wait Time ).

A default value for Server Wait time , I believe , is there in the AMQP client , where the value has been set to 30 seconds (DefaultOperationTimeout in com.microsoft.azure.servicebus.primitives.MessagingFactory.java class).

So , the server waits for 30 seconds before responding to a receive message call , if there are no messages in the queue at that instant. Right ?

Can we get support to change this value and maybe set this value on the queue as attributes so that any client listening to that queue can see this value and update it ?

Also support to change the max message size for a queue at any time . (At the server side , not at the client side ).

Or could you propose any alternative to change these 2 queue attributes ?

I know management operations are not yet supported by this client code . Till that is provided in here , I will have to continue using the older version of the client simultaneously .

If this is not the correct forum for this issue , could you please redirect me to the appropriate place maybe ?

Make sure resources are disposed properly

Hi,
Sending a message and closing the client Java program continues to run in Eclipse and it needs to be terminated

queueClient = new QueueClient(conStr.toString(), ReceiveMode.PeekLock);
queueClient.send(message);
queueClient.close();
} //End

  • OS platform and version: WIndows 7 64-bit
  • Maven package version or commit ID: 1.0.0-PREVIEW

Message deadlettering using JMS and deferred messages

Firstly I'd like to point out my question is mainly about JMS approach to Service Bus Queues and Topics which is a bit different from this library scope. Yet I believe this library is the closest to my use case.

I have a question about message acknowledgement/rejecting using JMS (And Spring jmsListener annotation). I would like to send messages which cannot be processed to the DLQ on a ServiceBus Queue I'm reading from.

If I use the simplest settings and use Session.AUTO_ACKNOWLEDGE mode on my listener, each message is acknowledged before it is actually processed. And there is no simple solution using JMS to reject the message later during processing. So it is basically lost if anything happens during processing. If I try to send the message manually to my destination's DLQ (e.g. testqueue/$DeadLetterQueue), it is sent to normal queue instead (testqueue in this case).

If I set Max Delivery Count on the Queue to 1 and use Session.CLIENT_ACKNOWLEDGE mode on my listener I can get the message to the DLQ if an exception is thrown on message processing. But this also causes loss of messages which are prefetched, but cannot be acknowledged in time (e.g. because the listening application shuts down).

If I raise Max Delivery Count on the Queue to 2 or more and an exception is thrown inside message processing method, the message stays in the original queue. It is not pushed to the DLQ at all. But it cannot be read anymore either. Because it remains in Deferred state. I cannot access it via normal message consumer, I cannot even remove it using ServiceBusExplorer tool (but I can check it via Peek mode). Apparently it is just waiting there for expiration messing with my queue.

While I thought there are only two disjunct states for the message (consumable in normal queue or dead lettered), there is apparently some third state the message can get into. Please let me know if there is any possibility to send messages to the DLQ using JMS approach without getting messages into some fuzzy state.

Thanks!

Versions

  • Qpid JMS client 0.23.0
  • Spring JMS 4.3.8-RELEASE

Artifact ID

Untill the management APIs are also implemented in this latest SDK , can the artifact id of this repository be something different from its previous versions ? (azure-servicebus is the artifact id for all versions )

We are using this SDK and an older version of this for the management APIs together .
So , there is a conflict in the build system as maven cannot differentiate two repositories just based on their version numbers .

RENEWSESSIONLOCK exception raised when many concurrent sessions configured

Hi,
I am trying to run 64 concurrent sessions, sending messages SessionID from 1 to 64, with the property java.util.concurrent.ForkJoinPool.common.parallelism=64
and receive these exceptions:

=====================================================
RECEIVE encountered exception: java.util.concurrent.TimeoutException: The operation did not complete within the allotted timeout of 00:02:00. The time allotted to this operation may have been a portion of a longer timeout. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:29a3c026-68fc-4822-a9d0-d90c5401c5fb_B20, SystemTracker:edpersb:queue:edq~159, Timestamp:4/18/2017 5:11:20 PM

Session closed.- null

RENEWSESSIONLOCK encountered exception: java.lang.UnsupportedOperationException: Invalid command 'com.microsoft:renew-session-lock'. TrackingId:bf85c826-26f6-4bd0-b4fc-84c864587fb0_B19, SystemTracker:NoSystemTracker, Timestamp:4/18/2017 5:01:17 PM

Please note:
The SessionID in the SessionClose message is"null"
The normal message is supposed to be like:
Session closed.- 48

printed from
@OverRide
OnCLoseSessionAssync
System.out.println("Session closed.- " + session.getSessionId());

Occasionally in such situation some session threads "get locked" and messages with specific SessionID stooped consuming and the app needs to be restarted.

Versions

  • OS platform and version: Windows 7 64-bit
  • Maven package version or commit ID: PREVIEW 0.1.0

Timeout period with receive message

I called send() function of MessageSender to send a message to a queue.
In the next line , I am receiving the message using the receive function of MessageReceiver.

In the server wait time , I am passing 0 as I want it to return immediately if there are no messages.
But this receive call always returns null. I have tested this using the test cases provided in this SDK,
There is a message in the queue , since I called send message function just before.

But if I give the server wait time as , say 500 ms , then it does return me the message.

If I pass 0 as server wait time in receive call , then it should return me the message , if there is one in the queue.

Performance Testing

I have done some performance testing for Azure Service Bus Queues using this SDK.

I have used the send(Message) function of MessageSender class to send 100k messages.
Size of each message is 8k.

The average response time for Service Bus is 7-8 times more than Azure Storage Queue response time for similar test.
I am not using the sendAsync function as we wouldn't know the round trip time to send a complete message.
Since this is a synchronous send call , client side batching is also disabled.

I am using a Premium Namespace. Message Duplication detection has been disabled.
Running this test from an Azure Virtual Machine instance whose specs are -> 4Core, 28GB RAM, 12800 IOPS.

Both the machine and the premium namespace are in the same region.

Any comments on the performance and suggestions to improve this ?

Missing documentation on 1.0.0-PREVIEW code

At the moment, there is zero documentation on new version of the library code. I need to develop custom message send/receive Spring projects as my current code using JMS based solution has some compatibility issues especially in message acknowledgement/dead lettering.

Now I basically have a few options:

  1. Develop on 0.9.7 version of the artifact with risking all of my code being invalid once version 1.0.0 is released. (most likely option)
  2. Trying to develop with preview version of the artifact with no knowledge at all about how objects and their methods work as the new artifact is completely reworked. And the only available information is pretty short sample with two classes. (I don't have enough time for such experiment)

So my questions are:

  1. What is the planned release date for version 1.0.0?
  2. Is there going to be documentation for the preview code? (Unless there is a release in a few weeks with documentation being part of it)

Thanks for the information!

Versions

  • 1.0.0-PREVIEW-1 artifact

Message Lock Duration

I want to specify the lock duration while receiving the message.
Also , I want to renew the lock duration of a particular message by a custom value.
Right now , the queue level lock duration value is used.

This is a major difference from both SQS and Azure Storage Queue.

Will message level lock duration functionality be supported by Azure Service Bus ?

MessageHandlerOptions.maxAutoRenewDuration should not be exposed

It looks like maxAutoRenewDuration is the time after which the lock on a message should be allowed to expire, and is completely unrelated to the message's processing status. For example, once the CompleteableFuture returned by the user's onMessageAsync is completed, the renewLockLoop is being cancelled before the message is marked as Completed with the Service Bus service. Within this window, another consumer could complete the message. I'm assuming the user's notifyException will be called in this case, but it's an error that the user should not need to worry about.

Why is this knob being exposed? A much better user experience would be for the message to be renewed automatically until it is marked completed or abandoned by the user within the CompleteableFuture returned by onMessageAsync or until an auto-abandon timeout is exceeded, at which point the CompleteableFuture returned by onMessageAsync should be cancelled, the message should be unlocked in Service Bus, and an error should be returned via notifyException.

about chinese garbled

Actual Behavior

  1. Chinese garbled:send chinese,then Receive the message, insert into mysql, then we see garbled in mysql.

Expected Behavior

  1. no garbled

Versions

  • OS platform and version: centos 7
  • Maven package version or commit ID: 1.0.0-PREVIEW

I am sorry, I can not give you detailed bug information. Because I no longer use service bus. Maybe you should check this question. Maybe I'm wrong, very sorry!

MaxConcurrentSessions ignored

Hi,
New version of the library 1.0.0-PREVIEW-1 does not receive messages from a Topic's subscription at all.
The same program receives messages using the previous version 1.0.0-PREVIEW.

  • OS platform and version: Windows, Linux
  • Maven package version or commit ID: 1.0.0-PREVIEW-1

Receive Batch messages

I am trying out the testBasicReceiveBatchAndComplete test case provided.
I have sent a bunch of 10 messages using sendBatch call.

After that , the receiveBatch returns 1 message in the first call.
It returns the remaining 9 in the second call.
This is the usual behavior.

But If I put a sleep after the sendMessage call , then the first receiveBatch call is itself returning all the 10 messages.

Could you clarify what is the expected behavior for the receiveBatch call ?
And why is there a difference in the two scenarios ?

MessageEntityNotFoundException

When I am creating a sender or receiver for a queue which does not exist , I am getting a default ServiceBusException with null as Error Context.

Shouldn't it throw a MessageEntityNotFoundException in this case ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.