How to Switch to different nodes if one of the nodes is down?
Equivalent command for "Create authorization rule" in Azurepowershell
Hello, am trying to get an equivalent cmlet for "Create authorization rule" in azure powershell to add an SAS policy (Send or listen) to existing eventhub. if it is a new eventhub I know we can use "$NamespaceManager.CreateEventHub" which will create eventhub with the policy we need, but for creating a second SAS policy for same eventhub I need a cmd equivalent to Rest-API "Create authorization rule".
Any help is really appreciated.
Price difference between Standard and Premium
I'm looking to stabilize my Azure Service Bus infrastructure. I'm experiencing poor performance from time to time, probably caused by noisy neighbours. I've looked at the premium pricing tier, but I've found it extremely expensive compared to Standard.
Just to make sure I understand correctly. A standard subscription with, let's say 20.000.000 messages per month is around $40 permonth. And if I choose the premium tier instead, it wil increase to almost $700 dollars. And this includes a single message unit only. I do understand that it is more expensive with a dedicated environment, but I think that a factor 17 is just crazy. Am I missing something?
New receiver with higher epoch Error in EventProcessorHost
Hi Experts,
I am using EventProcessorHost for reading Eventhub data and i got following error.
New receiver with higher epoch of '798393595' is created hence current receiver with epoch '17' is getting disconnected. If you are recreating the receiver, make sure a higher epoch is used. TrackingId:6368f7fc0004165d0001c7bb58238501_G34_B22, SystemTracker:dynmsg-push-evidence:eventhub:push-assignment-execute~28671|dsreporting, Timestamp:11/9/2016 8:21:32 PM
Note - I am not using EventHubReciever and used only EventProcessorHost way to read data from event hub. I can see first time it will run and read data from event hub but after that it will always throw error like above?
I there anyway we can avoid Epoch value to read data? Assuming i only want to achieve this using EventProcessorHost.
asthanarht
Cannot recreate a service bus topic on West US, getting errors
I have a major problem in my production environment on Azure.
I have an installation of a cloud service, table storage and service bus on West US for one of my customers.
In the service bus we use a combination of queues, topics and topic subscriptions.
One of the topics as started to act out.
Looking at both the classic portal and the new one, it kept disappearing from view and returning.
I tried to recreate it, but when I tried to delete it I got this error:
- Operation nameDelete Topics
- Time stampThu Nov 10 2016 15:30:27 GMT+0200 (Jerusalem Standard Time)
- Event initiated by*****
- Error codeGatewayTimeout
- MessageThe gateway did not receive a response from 'Microsoft.ServiceBus' within the specified time period.
- The topic no longer appear but now whenever I try to create it I'm getting this:
- Operation nameWrite Topics
- Time stampThu Nov 10 2016 15:48:38 GMT+0200 (Jerusalem Standard Time)
- Event initiated by***
- Error codeInternalServerError
- MessageSubCode=40901. Another conflicting operation is in progress. TrackingId:7c97bc1c-6e7d-45b8-8c6b-dede70a7187a_M0_M0_G5, SystemTracker:bcyber.servicebus.windows.net:accountnotifyupdate, Timestamp:11/10/2016 1:48:39 PM
Help
Massive Amount of Event Hub Usage - Errors & Implementation Problems
i've a web api that has to deal with nearly 200 request in a second. The main job of the web api application is:
- Get the request
- Go and find the answer from cache system (redis or whatever)
- Return the result
- Send that request to azure event hub (for making some hourly calculations)
The last step needs to be done without blocking the answer. The app needs to answer fast but in the mean time it also has to send the request information to azure event hub.
Im now doing this with:
public HttpResponseMessage Post(OurDataModel dataModel) { //1 - Get answer from cache var resultData = companyFactory.GetData(dataModel); //2 - sending data to Azure Event Hub var asyncResult = Task.Run(() => new AzureEventHub().SendData(resultData)); ..... //3 return result return Request.CreateResponse((HttpStatusCode)responseType.Ok, Json(resultData ).Content); }
Azure Sender Method:
public async Task<int> SendData(MainModel data) { //Create event list --> result is List<EventData> events ... EventHubClient eventHubClient = EventHubClient.CreateFromConnectionString(connString); client.SendBatch(events); client.Close(); return 1;//I dont know what im doing code :) }
This implementation does well but not very well actually. It does what is supposed to do that is, answering so many results without delay but, lately im getting so many errors from event hubs. It says;
First Error Message Type:
The operation did not complete within the allocated time 00:00:00 for object tls0. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101
Description: ..Exception Details: System.TimeoutException: The operation did not complete within the allocated time 00:00:00 for object tls0. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Second Error Message Type:
The operation has timed out.
Description: ..Exception Details: System.TimeoutException: The operation has timed out.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Strangely, it happens every 2-3 days and lasts about 10-15 mins then it goes fine again. These errors by the way
I have two questions:
Do i need to improve this implementation (Probably yes because it's like fire&forget)? Why? How?
Why im getting these errors?
I hope i made myself clear. Thank you.
High volume of socket/connection/certificate exceptions sending messages to queues/topics in Azure Service Bus
Hi -
Over the past few days we are seeing an increase in issues when sending messages to both queues and topics hosted in Azure Service Bus (not on-prem).
Messages are being sent from App Services in all situations, C#, standard MessagingFactory/QueueClient - this code has been running in production and unchanged for months. We typically have seen these errors sporadically in the past, and assumed it was a transient thing, but they've been happening with increased frequency in recent days
Three of the exceptions:
1)
An attempt was made to access a socket in a way forbidden by its access permissionsAn attempt was made to access a socket in a way forbidden by its access permissionsAn attempt was made to access a socket in a way forbidden by its access permissionsAn attempt was made to access a socket in a way forbidden by its access permissions
2)
2. Could not connect to net.tcp://XXXXXX.servicebus.windows.net:9354/. The connection attempt lasted for a time span of 00:00:00. TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permissions. Could not connect to net.tcp://XXXXXX.servicebus.windows.net:9354/. The connection attempt lasted for a time span of 00:00:00. TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permissions. An attempt was made to access a socket in a way forbidden by its access permissions
3)
3. The X.509 certificate CN=servicebus.windows.net is not in the trusted people store. The X.509 certificate CN=servicebus.windows.net chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority. The X.509 certificate CN=servicebus.windows.net is not in the trusted people store. The X.509 certificate CN=servicebus.windows.net chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority. The X.509 certificate CN=servicebus.windows.net is not in the trusted people store. The X.509 certificate CN=servicebus.windows.net chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority.
Top of the stack:
Microsoft.ServiceBus.Messaging.MessagingCommunicationException:at Microsoft.ServiceBus.Common.AsyncResult.End (Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.RunSynchronously (Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.ServiceBus.Messaging.MessageSender.OnSend (Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.ServiceBus.Messaging.MessageSender.Send (Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.ServiceBus.Messaging.MessageSender.Send (Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.ServiceBus.Messaging.QueueClient.Send (Microsoft.ServiceBus, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
Servicebus multiple jobs
We have 7-8 Webjobs running that are supposed to process the same info in a specific order. What is the preferred way of doing this with servicebus? Is there best practice to use the servicebus for this?
At the moment I'm at something like this:
The packet comes in from our clients, goes through 2 jobs, and then gets sent to 3 jobs (not all of them are always necessary, they're sharing jobs. Some packets go to facebook, some to FTP, some both,.. And only after all 3 of them are done the last Job can proceed, since it's based on the info the 3 jobs give.
We could write states to the database, but we're specfically switching to servicebus to work transactional with our packets, have an easy way to recover on crashes and so on.
Also, would the best way be 4 different servicebusses or 1 bus where (if that is even possible) we requeue the same packet with a state field? For example add a statefield "Job1=OK" and Job 2 has a subscription on that field, so that it gets the packet when it's passed Job1. That would be ideal, it would also miminize the traffic to the servicebus since the packet stays on it until the end..
After some searching I found that I can forward messages, but can I forward them to the same topic too? And can I add data to them? And if I forward a message, does that count as an extra message in pricing?
Is there a property or method within the MessageReceiver or MessagingFactory which will tell me if OnMessage/Async is currently active?
I would like to know if it's possible to check if a MessageReceiver OnMessage or OnMessageAsync method has already been called before trying to call one of these methods, rather than handling the exception:
"The method 'OnMessage' or 'OnMessageAsync' has already been called."
afterwards without manually setting up a flag to do this. Since the service bus is aware of the status of these 'listeners', surely it must expose this info somewhere?
Is it a good idea to use QueueBackgroundWorkItem for event hub send data operations?
Hi everyone,
I have a wep api that getting more than 100 request in a second and it needs to answer back fast.
There are two main job in every request:
-Get the answer from cache and return it to user
-Send the result to event hub (for some hourly calculations)
The second part doesnt interest the api caller. So any errors and slowness, timeouts shouldnt change my response time.
My questions:
So how should be the implementation?
Can i use "HostingEnvironment.QueueBackgroundWorkItem" for that kind of background job? What are your suggestions?
Can using async version of event hub send methods change anything about scalability and performance for the possible implementations?
Service Bus Relay TCP Ports
Could you please clearly explain when to use TCP Ports 9531, 9353 and 9354 ports in Service Bus Relay?
Issue to connect to events hub through java client
Hello,
I followed the Azure tutorial at https://azure.microsoft.com/en-us/documentation/articles/event-hubs-java-ephjava-getstarted/
But when trying to connect and send message i get the following exception.
Nov 15, 2016 6:45:34 PM com.microsoft.azure.servicebus.MessagingFactory$RunReactor run
WARNING: UnHandled exception while processing events in reactor:
java.lang.IllegalArgumentException
org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:112)
org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:307)
org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:327)
java.lang.Thread.run(Unknown Source)Cause: null
java.nio.Buffer.position(Unknown Source)
org.apache.qpid.proton.engine.impl.ssl.SimpleSslTransportWrapper.pop(SimpleSslTransportWrapper.java:411)
org.apache.qpid.proton.engine.impl.ssl.SslImpl$UnsecureClientAwareTransportWrapper.pop(SslImpl.java:185)
org.apache.qpid.proton.engine.impl.TransportImpl.pop(TransportImpl.java:1476)
org.apache.qpid.proton.reactor.impl.SelectorImpl.select(SelectorImpl.java:145)
org.apache.qpid.proton.reactor.impl.IOHandler.handleQuiesced(IOHandler.java:57)
org.apache.qpid.proton.reactor.impl.IOHandler.onUnhandled(IOHandler.java:381)
org.apache.qpid.proton.engine.BaseHandler.onReactorQuiesced(BaseHandler.java:87)
org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:206)
org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:307)
org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:327)
java.lang.Thread.run(Unknown Source)
Exception in thread "main" com.microsoft.azure.servicebus.ServiceBusException: java.lang.IllegalArgumentException, TrackingId: 538718db-aa63-47fc-853d-ff078ee07689, at: 2016-11-15T18:45:34.235+05:30[Asia/Calcutta]
at com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:351)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException
at java.nio.Buffer.position(Unknown Source)
at org.apache.qpid.proton.engine.impl.ssl.SimpleSslTransportWrapper.pop(SimpleSslTransportWrapper.java:411)
at org.apache.qpid.proton.engine.impl.ssl.SslImpl$UnsecureClientAwareTransportWrapper.pop(SslImpl.java:185)
at org.apache.qpid.proton.engine.impl.TransportImpl.pop(TransportImpl.java:1476)
at org.apache.qpid.proton.reactor.impl.SelectorImpl.select(SelectorImpl.java:145)
at org.apache.qpid.proton.reactor.impl.IOHandler.handleQuiesced(IOHandler.java:57)
at org.apache.qpid.proton.reactor.impl.IOHandler.onUnhandled(IOHandler.java:381)
at org.apache.qpid.proton.engine.BaseHandler.onReactorQuiesced(BaseHandler.java:87)
at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:206)
at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:307)
at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
at com.microsoft.azure.servicebus.MessagingFactory$RunReactor.run(MessagingFactory.java:327)
... 1 more
Please help me resolve this issue
Connectivity Mode vs Transport Type
I have multiple instances of Service Bus 1.1 that I need to code for. Some are on virtual machines, some are on their own windows machine running Windows Server 2012 R2. The most frequent issue I encounter is determining how to connect. I need to understand this better. Specifically, what is the relationship between Connectivity Mode and Transport Type. For example, does Tcp go better with Amqp? Should Http go with NetMessaging? Also, sometimes I have to pass in credential keys in the connection strings and sometimes I do not. Same with passing in an StsEndpoint. Why?
Is there a book or online resource that clearly explains how these work?
Thanks.
Please Vote &/or "Mark As Answer" if this post is helpful to you. Thanks and happy coding :D
When to use tcpRelayTransport
Hi,
Could someone explain me the usage of the tcpRelayTransport ?
Thanks in advance.
Regards,
Madura
Slow response on QueueClient.CreateFromConnectionString
Hi,
When we run this localy it returns after 10-30 seconds.
var queueClient = QueueClient.CreateFromConnectionString(connectionString, "queuename");
This only happends first time. If we call it second time it will return very fast.
Timeout on communication from web app to service bus topics
I started seeing timeouts yesterday, when communicating from a web app to service bus. My setup is a web app with an API endpoint, doing nothing else that getting a message count on a service bus subscription. The following screenshot show a graph of requests from Pingdom, executed again my API endpoint in the last 7 days. As you can see, problems started yesterday at some time.
I know that the rest of the API works, since I don't see any issues with the other endpoints I'm monitoring. And the weird thing is, that it switches from timing out to working to timing out to working etc.
I switched to a duplicated setup I have running in Europe and everything runs smooth there. I must admit, that I'm frustrated with service bus right now. This is the third major problem I've had with it in a month. I know that I'm on a shared plan, but a shared plan that doesn't work 3 times in a month, isn't really usable for anything. The real problem here is, that the Azure status dashboard have been green all three times and I get the usual "we are not aware of any problems right now" when contacting support.
How to organize topics and subscriptions for an enterprise solution?
We are currently considering Azure Service Bus Premium to deliver certain time sensitive information to our users.
However, I've learned that there are limits on the number of topics that we can have. And within topics there is a limit for subscriptions.
We originally wanted to create a topic per user, but we won't fit within the 10,000 topic limit. We could create a topic per company, but we might not fit within the 2,000 subscription limit per topic.
Is this the right way to be thinking about this? Is there a better way to organize namespaces / topics / subscriptions?
Service Bus vNext roadmap?
Will version 2.0 be released for on-premise Windows Service Bus?
I see that version 2.0 of the Service Bus has been released onto Azure, but the Windows Server version is still stuck at version 1.0
Does Service Bus have a future for on-premise applications? Obviously we'd all like to put everything in the Cloud, but real companies have real legacy applications running on-premise and you can't re-write them all in months (or even years). Our ideal architecture is to use Service Bus to loosely couple legacy applications with new applications as we gradually move to the cloud, but we need to know that this is going to be supported.
Or is Microsoft just throwing all of its energy at Azure and ignoring on-premise applications?
BrokeredMessage being disposed when accessed from a separate thread.
Hi,
I am trying to work with a simple example of ServiceBus to place received items on to an in-memory queue, and then read them off at a later time from any number of processing threads.
This pattern is mentioned in the official documentation to increase throughput through a service bus.
Anyway, here's the example:
private static string _serviceBusConnectionString = "XXX"; private static BlockingCollection<BrokeredMessage> _incomingMessages = new BlockingCollection<BrokeredMessage>(); private static CancellationTokenSource _cancelToken = new CancellationTokenSource(); private static QueueClient _client; static void Main(string[] args) { // Set up a few listeners on different threads Task.Run(async () => { while (!_cancelToken.IsCancellationRequested) { var msg = _incomingMessages.Take(_cancelToken.Token); if (msg != null) { try { await msg.CompleteAsync(); Console.WriteLine($"Completed Message Id: {msg.MessageId}"); } catch (ObjectDisposedException) { Console.WriteLine("Message was disposed!?"); } } } }); // Now set up our service bus reader _client = GetQueueClient("test"); _client.OnMessageAsync(async (message) => { await Task.Run(() => _incomingMessages.Add(message)); }, new OnMessageOptions() { AutoComplete = false }); // Now start sending Task.Run(async () => { int sent = 0; while (!_cancelToken.IsCancellationRequested) { var msg = new BrokeredMessage(); await _client.SendAsync(msg); Console.WriteLine($"Sent {++sent}"); await Task.Delay(1000); } }); Console.ReadKey(); _cancelToken.Cancel(); } private static QueueClient GetQueueClient(string queueName) { var namespaceManager = NamespaceManager.CreateFromConnectionString(_serviceBusConnectionString); if (!namespaceManager.QueueExists(queueName)) { var settings = new QueueDescription(queueName); settings.MaxDeliveryCount = 10; settings.LockDuration = TimeSpan.FromSeconds(5); settings.EnableExpress = true; settings.EnablePartitioning = true; namespaceManager.CreateQueue(settings); } var factory = MessagingFactory.CreateFromConnectionString(_serviceBusConnectionString); factory.RetryPolicy = new RetryExponential(minBackoff: TimeSpan.FromSeconds(0.1), maxBackoff: TimeSpan.FromSeconds(30), maxRetryCount: 100); var queueClient = factory.CreateQueueClient(queueName); return queueClient; }
Playing around with settings I cannot get the BrokeredMessage to not be Disposed. As you can see, I'm not calling anything apart from the attempted call to .CompleteAsync.