Quantcast
Channel: Service Bus forum
Viewing all 1916 articles
Browse latest View live

Question about Event Hub

$
0
0

hi,

   Background: The purpose for the app is to find out ServiceBus event hub's max capacity for reading/writing messages.

   environment: 2 senders which sending batch of data per 10 seconds to the event hub, while 2 receivers are receiving messages from the event hub, then either insert into table storage/ blob storage. (also the reading/writing capacity to storage will be found out.)

   each sender: current environment settings: total devices =500, total tags=50000, sample rate=10 seconds

it means 500 commit per 10 seconds, each commit contains 100 columns which is 17482 bytes in total.

however, after almost 3 mins, the log shows below ServerBusyException.

My question is what the root cause for the throttled.

Here is the log

[2016-05-04 02:41:55,751]  1 -- INFO  -- LogInfo [WriteLog] -- step 2: Launch agent instances to submit data.........

 ...............................

[2016-05-04 02:44:11,151]  3 -- ERROR -- LogError [WriteLog] -- Submit data failed.
Microsoft.ServiceBus.Messaging.ServerBusyException: The request was terminated because the entity is being throttled. Error code : 50002. Please wait 4 seconds and try again. TrackingId:a30dd90a000066430007ba7457296147_G18_B5, Reference:b315d19a-405a-49d9-b118-f72e820b8e2e, Timestamp:5/4/2016 2:44:09 AM
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.MessageSender.EndSendEventData(IAsyncResult result)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

Here is the C# code

EventHubClient client = EventHubClient.CreateFromConnectionString(
                                ServiceBusSettings.ServiceBusConnectionString,
                                ServiceBusSettings.DefaultTagvalueEventHubName);
            string dataStr = string.Empty;
                try
                {
                    client.RetryPolicy = RetryPolicy.Default;
                    dataStr = JsonConvert.SerializeObject(data);
                    //LogHelper.WriteLog(string.Format("each message = {0} bytes", dataStr.Length));
                    var dataInByte = Encoding.UTF8.GetBytes(dataStr);

                         var eventData = new EventData(dataInByte) { PartitionKey = data.CollectionGroupKey };
                        await client.SendAsync(eventData);
                        await client.CloseAsync();
                        tagsCount.AddCount(data.Samples.Sum(s => s.TagValues.Count()));
                        LogHelper.WriteLog(string.Format("Submitted total {0} tags.", tagsCount.TagsCount));
                }
                catch (Exception ex)
                {
                    if (!client.IsClosed)
                    {
                        client.Abort();
                    }

                    LogHelper.WriteLog(string.Format("Submit data failed. current data size ={0} bytes.", dataStr.Length), ex);
                }


When will Service Bus have DNXCORE50 Support

$
0
0

With the release of the new ASPNET5 DNXCORE50 platform just around the corner, when will we see support for Service Bus using CoreCLR?

I would really like to use it for a new project that I am busy developing, and currently I have to fall back to Azure Storage Queues (which already have beta support for this platform) because Service Bus is simply not available. This includes AMQP Lite and SB.NET.

Regards,

Stephan


Regards, Stephan Johnson Blue Marble Software (Pty) Ltd. stephanj@bluemarble.co.za

Post Processing of Event Hub events: What's the best way to design an "event post processing pipeline"?

$
0
0

After an Event Hub has received an event, I want to design a "consumer" that will pass the event object through a pipeline of custom processing functions ...the last module would write the post-processed event to a Azure Table or Azure SQL Database. I want these pipelines to be easily extended, composable and performant.   ...kind of like a PowerShell pipeline for Event Hub Events.

Azure Data Factory does part of this but as far as I've been able to determine, Data Factory doesn't have native support for reading events in an Event Hub ...you need to write a custom Event Hub receiver/consumer that would first write the events to some sort of Azure Storage (which seems wasteful when the events have already been persisted in an Event Hub).  Another option would be to write a custom DotNetActivity for Data Factory but I don't want to do this when Data Factory should have its own native supported for reading from an Event Hub.

Stream Analytics would be another option. The service understands Event Hub data but it seems like overkill and I haven't been able to determine if it supports something similar to custom DotNetActivities.

Any ideas for an Event Hub post-processing pipeline that is lightweight, easily extended, easily composable and performant?

Best regards,

Michael Herman (Toronto)


Xpert Search Agents for Microsoft web sites: http://www.parallelspace.net/MicrodeX

Service bus restoration

$
0
0

Hello,

we restored service bus to different servers. we are getting below errors in event viewer after restoration

MessageEntity load failed. Entity name = container 1-PRODUCTIONEXECUTION:QUEUE:PRODUCTIONORDERCONFIRMATIONACKNOWLEDGEMENTQUEUE, error = System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type Microsoft.ApplicationServer.Messaging.Broker.QueueInfo. The input source is not correctly formatted. ---> System.Xml.XmlException: The input source is not correctly formatted.
   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
   at System.Xml.XmlBufferReader.ReadValue(XmlBinaryNodeType nodeType, ValueHandle value)
   at System.Xml.XmlBinaryReader.ReadNode()
   at System.Xml.XmlBaseReader.IsStartElement()
   at System.Xml.XmlBaseReader.IsStartElement(XmlDictionaryString localName, XmlDictionaryString namespaceUri)
   at System.Runtime.Serialization.XmlObjectSerializer.IsRootElement(XmlReaderDelegator reader, DataContract contract, XmlDictionaryString name, XmlDictionaryString ns)
   at System.Runtime.Serialization.DataContractSerializer.InternalIsStartObject(XmlReaderDelegator reader)
   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
   --- End of inner exception stack trace ---

Server stack trace: 
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.SerializationUtilities.DeserializeObject[T](Byte[] serializedObject)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.GetEntityInfoAsyncResult.GenerateQueueInfo(Byte[] queueProperties, Int64 version, DateTime acceseedAt, String entityName)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.GetEntityInfoAsyncResult.ParseResult(SqlDataReader reader, String entityName, Boolean isRecursive, SqlContainerLocation containerLocation, TrackingContext currentTracker)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.GetEntityWithAssociatedInfoAsyncResult.ParseResult(SqlDataReader reader, EntityDataOutputResultType outputDataType, SqlContainerLocation containerLocation, TrackingContext currentTracker)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.GetEntityWithAssociatedInfoAsyncResult.ProcessSqlResult(SqlDataReader reader)
   at Microsoft.Cloud.ServiceBus.Common.Sql.SqlStoreAsyncResult.SqlCommandAsyncResultCallback(IAsyncResult result)
   at Microsoft.ServiceBus.Common.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

Exception rethrown at [0]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.EntityDataReader.GetEntityDataAsyncResult.<GetAsyncSteps>b__15(GetEntityDataAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)

Exception rethrown at [1]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.EntityDataReader.PopulateEntityDataAsyncResult.<GetAsyncSteps>b__8(PopulateEntityDataAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)

Exception rethrown at [2]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.EntityStore.GetSingleEntityInfoAsyncResult.<GetAsyncSteps>b__6(GetSingleEntityInfoAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)

Exception rethrown at [3]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ApplicationServer.Messaging.Broker.Sql.SqlMessageStoreFactory.EndRead(IAsyncResult result)
   at Microsoft.ApplicationServer.Messaging.Broker.MessageEntityManager.OnCreateInstanceAsyncResult.<GetAsyncSteps>b__3d(OnCreateInstanceAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)

Exception rethrown at [4]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ApplicationServer.Messaging.Broker.MessageEntityManager.OnEndCreateInstance(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.SingletonDictionaryManager`2.LoadInstanceAsyncResult.<GetAsyncSteps>b__d0(LoadInstanceAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)

Exception rethrown at [5]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ApplicationServer.Messaging.Broker.MessageEntityManager.LoadEntityAsyncResult.<GetAsyncSteps>b__2c(LoadEntityAsyncResult thisPtr, IAsyncResult r)
   at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result).

After further checks found that microsoft.servicebus.dll DLL version of new installation (2.0.50917.2) and old installation (2.0.30904.0) is different.

Any help here ?

Thanks,

venky

ServiceBus Authorization rule creation always fails with "Request to a downlevel service failed"

$
0
0

Hi All,

I am using \packages\Microsoft.WindowsAzure.Management.ServiceBus.0.17.1-preview\lib\net40\Microsoft.WindowsAzure.Management.ServiceBus.dll

 ServiceBus Authorization rule creation always fails with {"<string xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/\">Request to a downlevel service failed.</string>"}

 var tServiceBusAuthorizationRuleResponse = serviceBusManagementClient.Namespaces.CreateAuthorizationRuleAsync(name,
                         new ServiceBusSharedAccessAuthorizationRule()
                         {
                             KeyName = "Send",
                             Rights = new[] { AccessRight.Send }
                         }, CancellationToken.None);
var serviceBusAuthoriaztionRuleResponse = tServiceBusAuthorizationRuleResponse.Result;

Any Suggestions.

How to resolve the issue as when I receiving the messages from IoT hub at that time any of the IoT device will be turn off then I did not get any messages from IoT Hub, just UWP app will be open but not displaying any values from IoT Hub.

$
0
0

Hi,

I am Working on Internet of things, in one of my current project I need to receive the messages from IoT Hub, before I receiving the messages from IoT Hub, first I was sending messages from Two IoT devices to IoT hub. after I was sent messages to IoT hub then I am trying to receive the messages from IoT hub, in this scenario one my IoT device will be turn off, at this time I did not get any  messages from IoT hub.

But if two IoT devices are working properly then only I got the messages from IoT Hub.

see the below code.

publicasyncvoid ReceiveDataFromCloud()

       {

          

           ServiceBusConnectionStringBuilder builder =newServiceBusConnectionStringBuilder(ConnectionString);

           builder.TransportType = ppatierno.AzureSBLite.Messaging.TransportType.Amqp;

 

           factory = MessagingFactory.CreateFromConnectionString(ConnectionString);

 

           client = factory.CreateEventHubClient(eventHubEntity);

           group = client.GetDefaultConsumerGroup();

 

           startingDateTimeUtc = DateTime.UtcNow;

 

           for (int i = 0; i <= 0; i++)

           {

 

EventHubReceiver receiver = group.CreateReceiver(i.ToString(), startingDateTimeUtc);

 

               EventData data = receiver.Receive();--à this line of code will give the data value when I connected to one IoT device but when I connected to two IoT devices the data will not give any value just it will stop the debugging.

 

               if (data !=null)

               {

                   var receiveddata =Encoding.UTF8.GetString(data.GetBytes());

 

                   var messageString =JsonConvert.DeserializeObject<ConferenceRooms>(receiveddata);

                   

                   confrooms.Add(messageString);

 

                   //var message = new ConferenceRooms(Encoding.ASCII.GetBytes(receiveddata));

 

                   Debug.WriteLine("{0} {1} {2}", data.PartitionKey, data.EnqueuedTimeUtc.ToLocalTime(),Encoding.UTF8.GetString(data.GetBytes()));

               }

               else

               {

                   continue;

               }

 

               receiver.Close();

           }

          

           client.Close();

           factory.Close();

           progressring.Visibility = Visibility.Collapsed;

           progressring.IsActive = false;

       }

Please tell me how to resolve this issue?

Thanks & Regards

G. Pradeep Kumar Reddy

What´s the best way to connect a siemens PLC to IoT hub?

$
0
0

From @UlissesOPaiva via Twitter

"@AzureSupport What´s the best way to connect a siemens PLC to IoT hub? Have I implement AMQP on PLC or I can use OPC UA?"

http://twitter.com/UlissesOPaiva/status/694927861409570816

Thanks,

@AzureSupport

ARM templates - Event hub consumer group creation fails with status code conflict, even though it is an incremental deployment

$
0
0

Hello All,

We are trying to do an incremental ARM deployment.

But the deployment behaves differently at different time:

  1. sometime fails with the statuscode:Conflict
  2. most time succeeds but the Audit log has this error with status code ‘Conflict’

<refer screen shot>

Since we are using incremental deployment.  As defined in this link , incremental updates does not re-provision resources that exist in the resource group.  Can some help us understand why are we getting this error.

PFA the error screenshot. 

Thanks

Madhanerror-msg


MessagingCommunicationException Exception Type

$
0
0
From @joec7B6 via Twitter,
 
For 75D, everything’s been stable with SBus until last Thursday when we started getting MessagingCommunicationException causing restarts to resolve.  What up?

FYI, In March, we opened a support ticket and received this explanation for the outage:
Cause: Service Bus billing component was experiencing throttling errors while writing to permanent Azure storage. Some code paths are not handling these exceptions appropriately and resulting in internal server exceptions to our customers. In a couple of code paths it has blocked a node from coming up entirely and some role instances recycled a few times. This was causing client side out timeout errors.

Is there any way to be informed when our instances are impacted by events like these?  Has anything like this been occurring over the past few days?

Thanks,
@AzureSupport


Windows Service Bus 1.1 Breaks for AMQP Clients when KB3155464 is applied

$
0
0

Wasn't sure where else to log this hopefully this will at least help any one searching for this on Google/Bing.

We have identified that KB3155464 (https://support.microsoft.com/en-us/kb/3155464) breaks Service Bus For Windows 1.1 for Java AMQP clients. In our case it was using the Mule ESB Windows Service Bus connector but it is just Apache Qpid under the hood so will probably be more wide spread. I haven't tried but I suspect the example documented at https://msdn.microsoft.com/en-us/library/dn574799.aspx will reproduce the issue outside of Mule ESB.

The work around is to apply the registry opt-out listed in the KB article. Service Bus only seems to accept TLSv1.0 connections so this probably does mean that connections can't be considered secure any more so a fix is probably needed at either the Java or .NET end. We will also be logging with with Mule ESP support.

Environments affected:

1) Windows Server 2012 R2, fully patched, .NET 4.6. Oracle Java 1.8u92.

2) Windows 7 64-bit, fully patched, .NET 4.6. Oracle Java 1.8u92.

Logs from Mule ESB for reference (and google):

WARN  2016-05-16 12:36:26,250 [DefaultMessageListenerContainer-362] org.springframework.jms.listener.DefaultMessageListenerContainer: Setup of JMS message listener invoker failed for destination 'org.apache.qpid.amqp_1_0.jms.impl.QueueImpl@ed015225' - trying to recover. Cause: An AMQP error occurred (condition='amqp:connection:forced')..TrackingId:22fdc6ec9a6744da834d756472ec2038_GSERVERNAME,TimeStamp:16/05/2016 2:36:21 AM
WARN  2016-05-16 12:36:31,282 [DefaultMessageListenerContainer-363] org.springframework.jms.listener.DefaultMessageListenerContainer: Setup of JMS message listener invoker failed for destination 'org.apache.qpid.amqp_1_0.jms.impl.QueueImpl@ed015225' - trying to recover. Cause: An AMQP error occurred (condition='amqp:connection:forced')..TrackingId:22fdc6ec9a6744da834d756472ec2038_GSERVERNAME,TimeStamp:16/05/2016 2:36:26 AM

And on other machines it comes through as a timeout error instead:

WARN  2016-05-20 16:18:38,082 [DefaultMessageListenerContainer-69] org.springframework.jms.listener.DefaultMessageListenerContainer: Setup of JMS message listener invoker failed for destination 'org.apache.qpid.amqp_1_0.jms.impl.QueueImpl@ed015225' - trying to recover. Cause: Timeout waiting for attach
javax.jms.JMSException: Timeout waiting for attach
    at org.apache.qpid.amqp_1_0.jms.impl.MessageConsumerImpl.createClientReceiver(MessageConsumerImpl.java:178) ~[?:?]
    at org.apache.qpid.amqp_1_0.jms.impl.MessageConsumerImpl.<init>(MessageConsumerImpl.java:129) ~[?:?]
    at org.apache.qpid.amqp_1_0.jms.impl.MessageConsumerImpl.<init>(MessageConsumerImpl.java:89) ~[?:?]
    at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.createConsumer(SessionImpl.java:435) ~[?:?]
    at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.createConsumer(SessionImpl.java:406) ~[?:?]
    at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.createConsumer(SessionImpl.java:59) ~[?:?]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.createConsumer(AbstractMessageListenerContainer.java:834) ~[spring-jms-4.1.6.RELEASE.jar:4.1.6.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:206) ~[spring-jms-4.1.6.RELEASE.jar:4.1.6.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:1167) ~[spring-jms-4.1.6.RELEASE.jar:4.1.6.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1143) ~[spring-jms-4.1.6.RELEASE.jar:4.1.6.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1136) ~[spring-jms-4.1.6.RELEASE.jar:4.1.6.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033) ~[spring-jms-4.1.6.RELEASE.jar:4.1.6.RELEASE]
    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
Caused by: org.apache.qpid.amqp_1_0.client.ConnectionErrorException: Timeout waiting for attach
    at org.apache.qpid.amqp_1_0.client.Receiver.<init>(Receiver.java:187) ~[?:?]
    at org.apache.qpid.amqp_1_0.client.Session.createReceiver(Session.java:281) ~[?:?]
    at org.apache.qpid.amqp_1_0.client.Session.createReceiver(Session.java:192) ~[?:?]
    at org.apache.qpid.amqp_1_0.jms.impl.MessageConsumerImpl.createClientReceiver(MessageConsumerImpl.java:166) ~[?:?]
    ... 12 more

Upgrading a service to 1.8 causes MessageBufferClient not found error

$
0
0

We have an old Windows Service.  We have discovered a bug which I would like to fix and deploy.

However, since this was last worked on we are now using Visual Studio 2015 and the Azure Framework is 1.8 (think it might have been 1.4 before and Visual Studio 2013 maybe even 2010).

I have upgraded the solution and replaced many of the DLLs using Nuget.  We have integrations with CRM for example.  The project is .NET 4.0 which seems the most compatible for the moment.

My error is "The type or namespace MessageBufferClient could not be found".

From a little reading it sounds like MessageBufferClient is no longer supported.

Can someone steer me on what to do here?

I am not massively familiar with Queues and it is a legacy system so am looking to solve this fairly safely and easily.  A code sample of one of the functions is shown below:

public static MessageBufferClient GetMessageBufferClient()
        {
            String serviceNamespace = RoleEnvironment.GetConfigurationSettingValue("ServiceNamespace");
            String servicePath = RoleEnvironment.GetConfigurationSettingValue("ServicePath");
            String issuerName = RoleEnvironment.GetConfigurationSettingValue("IssuerName");
            String issuerSecret = RoleEnvironment.GetConfigurationSettingValue("IssuerKey");

            // Create the policy for the message buffer.
            MessageBufferPolicy policy = new MessageBufferPolicy();
            policy.Authorization = AuthorizationPolicy.Required;
            policy.MaxMessageCount = 10;
            // Messages in the message buffer expire after 5 minutes.
            policy.ExpiresAfter = TimeSpan.FromMinutes(5);
            policy.OverflowPolicy = OverflowPolicy.RejectIncomingMessage;

            // Create the credentials object for the endpoint.
            TransportClientEndpointBehavior credential = new TransportClientEndpointBehavior();
            credential.CredentialType = TransportClientCredentialType.SharedSecret;
            credential.Credentials.SharedSecret.IssuerName = issuerName;
            credential.Credentials.SharedSecret.IssuerSecret = issuerSecret;

            // Create the URI for the message buffer.
            Uri uri = ServiceBusEnvironment.CreateServiceUri(Uri.UriSchemeHttps, serviceNamespace, servicePath);

            return AzureHelper.GetOrCreateQueue(credential, uri, ref policy);
        }
Any help is greatly appreciated.

Event Hub: Unauthorized access. 'Send' claim(s) are required to perform this operation

$
0
0

I am receiving the following error when attempting to send telemetry to Event Hub using AMQP from an ASP.NET application.

Unauthorized access. 'Send' claim(s) are required to perform this operation. Resource: 'sb://changed-eh-ns.servicebus.windows.net/changed-eh'. TrackingId:7754266cd3f540099b6dda8ee0f66a10_G11,TimeStamp:12/7/2014 7:56:40 AM"

It seems pretty clear that I have some sort of authentication issue, but I've been unable to work out how to resolve it. I am trying to send from a ASP.NET web application.

namespace webns
{
    public partial class eventhubamqp : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            int sendCount = Convert.ToInt32(SendCount.SelectedValue);

            EventHubConnectSend(sendCount).Wait();
        }

        public async Task EventHubConnectSend(int sendCount)
        {
            var cs = @"Endpoint=sb://changed-eh-ns.servicebus.windows.net/;SharedAccessKeyName=EventHubListener;SharedAccessKey=0ZQ8Fp6nPfi1QFkXXXXXXb5NvBKEn1Am4B/n+zVq8LI=";

            var builder = new ServiceBusConnectionStringBuilder(cs)
                        {
                            TransportType = TransportType.Amqp
                        };

            var client = EventHubClient.CreateFromConnectionString(builder.ToString(), "changed-eh");

            for (int i = 0; i < sendCount; i++)
            {
                try
                {
                    var e = new Event
                    {
                        Message = "Test Message"
                    };

                    var serializedString = JsonConvert.SerializeObject(e);
                    var data = new EventData(Encoding.Unicode.GetBytes(serializedString))
                    {
                        PartitionKey = "0"
                    };

                    // Set user properties if needed
                    data.Properties.Add("Type", "Event");

                    await client.SendAsync(data).ConfigureAwait(false);
                }
                catch (Exception exp)
                {
                    Console.WriteLine("Error on send: " + exp.Message);
                }
            }

            return;
        }

    }

    [DataContract]
    public class Event
    {
        [DataMember]
        public string Message { get; set; }
    }

}

Glenn.

Default logging & message tracking in Service Bus for window server

$
0
0

Hi,

   I am new to window service bus and I am using on premises service bus for windows 1.1. Bus will be using publisher/ Subscription(Topics). Sending and receiving are two different organization on different network domain. I am worried that on receiving side it is possible to lost the message during processing and simply say that they never received it all.

Please suggest how this situation can be handle.

 Is service bus provide any default logging or message tracking which we can show it to the users(receiving party) in case questions rises?

Many Thanks.

Sending messages through a proxy

$
0
0
If I use REST API I can configure proxy server in my code so that messages are sent through the proxy. But in Service Bus SDK what is the way to do this?

Frank

Send message to queue gives the "40103: Invalid authorization token signature error"

$
0
0

I am new to the AZure.

I am trying to send a message to the service bus queue from javascript.

Below code gives me the "40103: Invalid authorization token signature error".Could you please help on this

I followed this article

http://developers.de/blogs/damir_dobric/archive/2014/03/18/windows-azure-service-bus-sending-the-message-to-queue-and-topic-with-javascript.aspx

  <script type="text/javascript">
        var m_ServiceNamespace = "MyQueue-ns";
       // var m_ServiceNamespace = "myqueue-ns";
        
        var m_SasKey = "tDkpA8LQ5OPoh/1fcWcBaVQZ6ZSByVxyasPsr+J4D4k="; //paste here key1     
        var m_SasKeyName = "RootManageSharedAccessKey";
        var environment = "servicebus.Windows.net";
        $(document).ready(function () {
            $("#btnSend").click(function () {
                alert("button");
                var txtMsg = "link"
                var msg = { "message": txtMsg, "id": 1234 };
                var queue = "myqueue";
                SB.sendMessage(queue, JSON.stringify(msg),
                  "application/json", function (messagingResult) {
                      var res = messagingResult;
                  });
            });
        });
        var getToken = function (entityPath) {

            var uri = "http://" + m_ServiceNamespace +
            ".servicebus.windows.net/" + entityPath;

            var endocedResourceUri = encodeURIComponent(uri);

            var t0 = new Date(1970, 1, 1, 0, 0, 0, 0);
            var t1 = new Date();
            var expireInSeconds = +(31 * 24 * 3600) + 3600 +
           (((t1.getTime() - t0.getTime()) / 1000) | 0);

            var plainSignature = escape(endocedResourceUri +"\n" + expireInSeconds)

            var hash = CryptoJS.HmacSHA256(plainSignature, m_SasKey);
            var base64HashValue = CryptoJS.enc.Base64.stringify(hash);

            var token = "SharedAccessSignature sr=" + endocedResourceUri + "&sig=" +
            encodeURIComponent(base64HashValue) + "&se=" + expireInSeconds + "&skn=" +
            m_SasKeyName;

            return token;
        }
        var utf8Encode = function (s) {
            for (var c, i = -1, l = (s = s.split("")).length,
                o = String.fromCharCode; ++i < l;
                s = (c = s.charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) +
                o(0x80 | (c & 0x3f)) : s
            );
            return s.join("");
        }
        var SB = {
           sendMessage: function (entityPath, body, contentType, callback) {
               var securityToken = getToken(entityPath);
               console.log(securityToken);
                var entityUri = "https://" + m_ServiceNamespace + "." +
                environment + "/" + entityPath;
                var sendUri = entityUri + "/messages";
                var xmlHttpRequest = new XMLHttpRequest();

                xmlHttpRequest.open("POST", sendUri, true);
                xmlHttpRequest.setRequestHeader('Content-Type', contentType);
                xmlHttpRequest.setRequestHeader("Authorization", securityToken);
                xmlHttpRequest.onreadystatechange = function () {

                    if (this.readyState == 4) {

                        var messagingResult;

                        if (this.status == 201) {
                            messagingResult = new MessagingResult("Success",
                            this.status, null, this.response);
                        }
                        else {
                            //messagingResult = new MessagingResult("Failure",
                            //this.status, null, this.response);
                            console.log(this.status +"Message" +this.response);
                        }

                        if (callback != null)
                            callback(messagingResult);
                    }
                };

                xmlHttpRequest.send(body);
            }
                 }
    </script>


Send message to queue gives the "40103: Invalid authorization token signature error"

$
0
0

I am new to the azure

I am trying to send a message to the service bus queue uisng javascript.But i am getting the below error

(40103: Invalid authorization token signature)

    <script type="text/javascript">
        var m_ServiceNamespace = "MyQueue-ns";
       // var m_ServiceNamespace = "sparchdocqueue-ns";
        
        var m_SasKey = "tDkpA8LQ5OPoh/1fcWcBaVQZ6ZSByVxyasPsr+J4D4k="; //paste here key1     
        var m_SasKeyName = "RootManageSharedAccessKey";
        var environment = "servicebus.Windows.net";
        $(document).ready(function () {
            $("#btnSend").click(function () {
                alert("button");
                var txtMsg = "link"
                var msg = { "message": txtMsg, "id": 1234 };
                var queue = "myqueue";
                SB.sendMessage(queue, JSON.stringify(msg),
                  "application/json", function (messagingResult) {
                      var res = messagingResult;
                  });
            });
        });
        var getToken = function (entityPath) {

            var uri = "http://" + m_ServiceNamespace +
            ".servicebus.windows.net/" + entityPath;

            var endocedResourceUri = encodeURIComponent(uri);

            var t0 = new Date(1970, 1, 1, 0, 0, 0, 0);
            var t1 = new Date();
            var expireInSeconds = +(31 * 24 * 3600) + 3600 +
           (((t1.getTime() - t0.getTime()) / 1000) | 0);

            var plainSignature = escape(endocedResourceUri +"\n" + expireInSeconds)

            var hash = CryptoJS.HmacSHA256(plainSignature, m_SasKey);
            var base64HashValue = CryptoJS.enc.Base64.stringify(hash);

            var token = "SharedAccessSignature sr=" + endocedResourceUri + "&sig=" +
            encodeURIComponent(base64HashValue) + "&se=" + expireInSeconds + "&skn=" +
            m_SasKeyName;

            return token;
        }
        var utf8Encode = function (s) {
            for (var c, i = -1, l = (s = s.split("")).length,
                o = String.fromCharCode; ++i < l;
                s = (c = s.charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) +
                o(0x80 | (c & 0x3f)) : s
            );
            return s.join("");
        }
        var SB = {
           sendMessage: function (entityPath, body, contentType, callback) {
               var securityToken = getToken(entityPath);
               console.log(securityToken);
                var entityUri = "https://" + m_ServiceNamespace + "." +
                environment + "/" + entityPath;
                var sendUri = entityUri + "/messages";
                var xmlHttpRequest = new XMLHttpRequest();

                xmlHttpRequest.open("POST", sendUri, true);
                xmlHttpRequest.setRequestHeader('Content-Type', contentType);
                xmlHttpRequest.setRequestHeader("Authorization", securityToken);
                xmlHttpRequest.onreadystatechange = function () {

                    if (this.readyState == 4) {

                        var messagingResult;

                        if (this.status == 201) {
                            messagingResult = new MessagingResult("Success",
                            this.status, null, this.response);
                        }
                        else {
                            //messagingResult = new MessagingResult("Failure",
                            //this.status, null, this.response);
                            console.log(this.status +"Message" +this.response);
                        }

                        if (callback != null)
                            callback(messagingResult);
                    }
                };

                xmlHttpRequest.send(body);
            }
                 }
    </script>

Java Client for Micorsoft Event Hub

$
0
0

Hi,

Do we have any Java sdk or Client for Microsoft Event hub which supports all the functionalities ?

Thanks

Increase Default TTL of message in service bus

$
0
0

I have a service bus 'basic' tier queue, in which the TTL of the message is 14 days. So if I have a message which is to be read after say 20 days, how can I do that without changing my subscription?

Also, I read that the default TTL of message is 10675199 days and am not able to set the TTL for more than 14 days.

Thanks in advance


- Ranjit (If you found this post useful, Please "Mark as Answer" or "Vote as Helpful)

Committing offset in Direct Receivers

$
0
0

hi,

Please somebody share me the code to Commit the offset in case of Direct receivers( consumers ) in MS Event Hub.

Thanks in advance.

How to receive the Data from a particular partition in Event hub using high level consumer.

$
0
0

Hi,

Could you Please somebody tell me how to receive the data from a particular partition in event hub using high level consumer. I tried with low level consumer i was able to do it but realized that we need to explicitly maintain the offset. I want something like I explicitly say that I need to receive the data from this partition and after that I should be able to checkpoint after that.

Thanks in advance,

Viewing all 1916 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>