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

Connect BTS to Azure Service Bus Quesues

$
0
0

Hi there, 

One of the apps on our BizTalk Server has a send port that points to SFTP server where it posts the messages which are being picked up by one of our Service Partners. 

We don't line the FTP and we want to connect both BTS and the Service Partner to Azure.

This will also allow us to further decouple the system. 

Question: Can I create a port in BizTalk Server that connect to Azure Service Bus Queues ?

How ? Is there a tutorial ?


God bless you all :)


CreateQueue using Simple REST client

$
0
0

I'm trying to create a queue on Azure using Service bus. Due to some restrictions I need to do it using RAW GET/PUT requests so I'm using Simple REST Client.


This is how I've created the signature mentioned in the Authorization field above:

HmacSha256 encoded the character string "PUT\n\n\n\n\n\n\n\n\n\n\n\nx-ms-date:Mon, 28 Sep 2015 09:40:57 GMT\nx-ms-version:2015-02-21\n/mynamespace-ns/testqueue\nrestype:queue\ntimeout:30" with the SharedAccessKey copied from the Connection Information > Access Connection Information > Connection String on the namespace webpage. After that Base64Encode the resulted string.

The response I'm getting is (401) Malformed Token: Invalid authorization header: The request is missing WRAP authorization credentials. True, but I'm not getting the enough information to generate the raw POST request query to get the token.


De-coupling my system

$
0
0

Hi there, 

Various systems at the premises of PartnerA connect via VPN to various systems at the premises of PartnerB to get access to data. 

Some of the systems of PartnerA will break if the connection is unreliable.

We would like to de-couple this system so if the subscriber or the publisher is offline the system is not getting broken. 

What are the options with windows Azure ?

I was thinking about:

1. Using the Service BUS queues and topics. ( The only concern I have is that there probably is a cap on the size of the message - (true or false ?) )

2. Using Service Bus and SQL DB on azure to create a staging DB. PartnerB Writes to Azure SQLDB and the messages get picked up whenever the subscriber is online. (Good idea ? ) 

3. Other ideas for decoupling a system like that highly welcomed :)


God bless you all :)

What's wrong with my service bus queue

$
0
0

In my chat application, I have a service bus queue created 2 years ago, which works perfectly good and very fast.

Now, I needed to create a twin application, so I created a new namespace and queue. It doesn't work. It takes 10-20 seconds to receive the message, and it does it in a random order.

I switched back to the old queue and it works perfectly again.

I've been researching for a couple of days but I don't find the reason. It's not a network problem because it happens everytime the last 2 days. Everytime I switch to the new one, it doesn't work, and switching back to the old one, it works fine.

When I created the new queue, I see that there's no more issuer name and issuer key, there's a different authorization model. So what I'm doing is:

this.client = QueueClient.CreateFromConnectionString(RoleEnvironment.GetConfigurationSettingValue("ServiceBus"), "chatmessage");

The old way was a bit more verbose

Uri namespaceAddress = ServiceBusEnvironment.CreateServiceUri("sb", baseAddress, string.Empty);

            this.namespaceManager = new NamespaceManager(namespaceAddress, TokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerKey));
            this.messagingFactory = MessagingFactory.Create(namespaceAddress, TokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerKey));

It's strange that, although I don't find anymore the issuer name and key in Azure portal, I still connect with those credentials.

But besides the way I create the queue client, there's no difference in the way I send and receive the messages. I simply do a Send() and Receive().

The only thing I see different is that, in azure portal, the namespace type is "messaging" for the new namespace, and "mixed" for the old namespace. But the queues have all the same properties.

Could somebody point me in any direction?

thank you.


Microsoft Service Bus Gateway Event ID 1000

$
0
0

I have Error when i have run the Services Bus 

Message:Failed to start Service Bus Gateway Service.

The description for Event ID 1000 from source Application Error cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

 

If the event originated on another computer, the display information had to be saved with the event.

 

The following information was included with the event:

 

Microsoft.ServiceBus.Gateway.exe

--

C:\Program Files\Service Bus\1.0\Microsoft.ServiceBus.Gateway

unknown

d2370348-66d6-11e5-80ba-00155d78a712

The description for Event ID 1025 from source .NET Runtime cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

 

If the event originated on another computer, the display information had to be saved with the event.

 

The following information was included with the event:

 

Application: Microsoft.ServiceBus.Gateway.exe

Framework Version: v4.0.30319

Description: The application requested process termination through System.Environment.FailFast(string message).

Message: Failed to start Service Bus Gateway Service.

Stack:

   at System.Environment.FailFast(System.String, System.Exception)

   at Microsoft.ServiceBus.Gateway.Gateway.OnStart(System.String[])

   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(System.Object)

   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

   at System.Threading.ThreadPoolWorkQueue.Dispatch()

 

 

The handle is invalid


Deepesh Yevle - MCTS MCITP


Getting messages from Azure Service bus is taking 120 to 160 seconds to complete

$
0
0

Hi,

I am trying to get messages from azure service bus queue, 

Here is the method , Queue is not a enabled for partition, and there are no messages in the queue(empty) at the time executing.

_queueClient.Receive(); 

Did anyone encounter this issue and any help will be appreciated? 

Another issue i am seeing is some time i am getting bunch of these errors  subsequently i get out of memory exception( see at the bottom of the page)

Error processing messages from service bus personevent, Exception=System.AggregateException: One or more errors occurred. ---> Microsoft.ServiceBus.Messaging.MessagingCommunicationException: Error during communication with Service Bus. Check the connection information, then retry. ---> System.ServiceModel.CommunicationObjectFaultedException: Internal Server Error: The server did not provide a meaningful reply; this might be caused by a premature session shutdown. TrackingId:2c81c790-971d-41f2-9d81-30d72e0697d4, Timestamp:9/29/2015 8:48:07 PM


Server stack trace: 


Exception rethrown at [0]: 
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.DuplexCorrelationAsyncResult.End(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<GetAsyncSteps>b__4(RequestAsyncResult 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.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.RequestAsyncResult.<>c__DisplayClass17.<GetAsyncSteps>b__a(RequestAsyncResult 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.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.EndRequest(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<GetAsyncSteps>b__4(RequestAsyncResult 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.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageReceiver.EndReceiveCommand(IAsyncResult result, IEnumerable`1& messages)
   --- End of inner exception stack trace ---
   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.ServiceBus.Messaging.MessageReceiver.RetryReceiveAsyncResult.TryReceiveEnd(IAsyncResult r, IEnumerable`1& messages)
   at Microsoft.ServiceBus.Messaging.MessageReceiver.EndReceive(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)
 

Memory Exception

System.InsufficientMemoryException: Insufficient winsock resources available to complete socket connection initiation. ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalBind(EndPoint localEP)
   at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
   at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
   at System.ServiceModel.Channels.SocketConnectionInitiator.ConnectAsyncResult.StartConnect()
   --- End of inner exception stack trace ---

how to define a service bus connection string to support the load balancing

$
0
0

We have created a service bus farm using  Service Bus for Windows Server 1.1 on one server and joined this existing farm from other 2 servers. And using netMessagingBinding for WCF applications

Now how to define a service bus connection string to support the load balancing.

Thanks in advance!!


Prince Jain


Logging Into Event Hub (Eventually into Azure Table)

$
0
0

Hello,

(Sorry, I didn't find relevant category for this post of posted in the Azure Backup section.)

I have BizTalk VMs in Azure and for logging purpose I use

System.Diagnostics.Debug.WriteLine("Message");

from my implementation. I have used same approach in my WCF services as well.

Is it possible to catch these events and write it to Event Hub?

I know how to write in Event Hub and how to move to Azure Table from there but I am not sure how to catch these events.

Please advise.

Regards,


Software Engineer


Windows Service (on-prem) - what permissions does the RunAs account need to have?

$
0
0

The services that get installed for an on-premise install need a domain account (for the RunAs parameter)- can't find any detail as to what rights this account needs. Can anyone expand?

Azure Service Bus WorkerRole not executing async Method

$
0
0

I have hosted Service Bus project on Azure and woker role is processing all messages. I have noticed that “asyncTaskWait() not executing always. sometime it is executing there is no guarantee it will work.

I am sure there is no exception and placed the logs before and after it is logging the details but not executing theasyncmethod.

sample code :

CreateInstance methodnot executing (inconsistent behavior)

MyTestClass is not creating instance (inconsistent behavior).

publicoverridevoid Run()

        {

           Trace.WriteLine("Starting processing of messages");

           OnMessageOptions options =newOnMessageOptions();

            options.AutoComplete =true;

            options.AutoRenewTimeout =TimeSpan.FromMinutes(1);

           // Initiates the message pump and callback is invoked for each message that is received, calling close on the client will stop the pump.

            Client.OnMessage((receivedMessage) =>

            {

               try

                {

                           Task.Factory.StartNew(() => longProcess(receivedMessage,ref Processcount, dictionary));

                }

               catch (Exception ex)

                {

                    logData("Run Expcetion:"+ ex.ToString());

                   // Handle any message processing specific exceptions here

                }

            });

           

        }

 publicvoid longProcess(BrokeredMessage receivedMessage, refint Processcount,Dictionary<string,string> dictionary)

        {

           try

            {

                CreateInstance(dictionary).Wait();

            }

           catch (Exception ex)

            {

                logData("Run Expcetion:"+ ex.ToString());

               // Handle exception here.

               // Log, write to poison message queue etc ...

            }

           finally

            {

            }

        }

       publicstaticasyncTask CreateInstance(Dictionary<string,string> dictionary)

        {

            logData("CreateInstanceThreadState:"+ Thread.CurrentThread.ThreadState.ToString());

            logData("CreateInstanceThreadId:"+ Thread.CurrentThread.ManagedThreadId.ToString());

            logData("CreateInstanceThreadIsBackGround:"+ Thread.CurrentThread.IsBackground.ToString());

           Console.WriteLine("CreateInstance");

           MyTestClass obj =newMyTestClass();

        }

Please help me.



Azure IoT Hub - REST APIs

$
0
0

Hello,

The only IoT Hub REST APIs doc I found is this one https://msdn.microsoft.com/library/mt548492.aspx. Are these the only available APIs? What about sending messages (in analogy with Event Hubs) via a REST API? 

Thanks.
Guy

Install Azure Service Bus locally which support for Relay Messaging

$
0
0

Hi,

I am using Azure Service Bus (Relay Messaging) for my application. I see in this link that we can install Service Bus on windows server (https://msdn.microsoft.com/en-us/library/jj193014.aspx).

I am not sure if Relay Messaging can work properly in this local Service Bus?

Please advise

Install Azure Service Bus locally which support for Relay Messaging

$
0
0

Hi,

I am using Azure Service Bus (Relay Messaging) for my application. I see in this link that we can install Service Bus on windows server (https://msdn.microsoft.com/en-us/library/jj193014.aspx).

I am not sure if Relay Messaging can work properly in this local Service Bus?

Please advise.

Example of Windows Server Service bus 1.1 using REST API

$
0
0

Hi 

I following tutorial of service bus brokered messaging using REST API https://msdn.microsoft.com/en-us/library/azure/hh416754.aspx

I get an exception 

Could not connect to net.tcp://<Machinename>.local:9350/. The connection attempt lasted for a time span of 00:00:02.1312727. TCP error code 10061: No connection could be made because the target machine actively refused it xx.xx.xx.xx:9350.

I am using Windows Server Service Bus 1.1 [NOT AZURE service bus] and below is the configuration file and code

App.config:

<configuration><startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup><system.net><defaultProxy useDefaultCredentials="true"><proxy bypassonlocal="True" usesystemdefault="True"/></defaultProxy></system.net><system.serviceModel><bindings><!-- Application Binding --><webHttpRelayBinding><binding name="default"><security relayClientAuthenticationType="None" /></binding></webHttpRelayBinding></bindings><extensions><!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. --><behaviorExtensions><add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></behaviorExtensions><bindingElementExtensions><add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus,  Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></bindingElementExtensions><bindingExtensions><add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></bindingExtensions></extensions><services><!-- Application Service --><service name="Micosoft.ServiceBus.Samples.ImageService"
               behaviorConfiguration="default"><endpoint name="RelayEndpoint"
                  contract="Micosoft.ServiceBus.Samples.IImageContract"
                  binding="webHttpRelayBinding"
                  bindingConfiguration="default"
                  behaviorConfiguration="sbTokenProvider"
                  address="sb://machinename.local/sbDefaultNamespace" /></service></services><behaviors><endpointBehaviors><behavior name="sbTokenProvider"><transportClientEndpointBehavior><tokenProvider><sharedAccessSignature keyName="RootManageSharedAccessKey" key="12345678090123456780901234567809012345678090" /></tokenProvider></transportClientEndpointBehavior></behavior></endpointBehaviors><serviceBehaviors><behavior name="default"><serviceDebug httpHelpPageEnabled="false" httpsHelpPageEnabled="false" /></behavior></serviceBehaviors></behaviors></system.serviceModel><appSettings><!-- Service Bus specific app setings for messaging connections --><add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer=owner;SharedSecretValue=[your secret]" /></appSettings></configuration>

code:

using Microsoft.ServiceBus;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;



namespace Micosoft.ServiceBus.Samples
{
    [ServiceContract(Name = "ImageContract", Namespace = "http://samples.microsoft.com/ServiceModel/Relay/RESTTutorial1")]
    public interface IImageContract
    {
        [OperationContract, WebGet]
        Stream GetImage();
    }

    [ServiceBehavior(Name = "ImageService", Namespace = "http://samples.microsoft.com/ServiceModel/Relay/")]
    public class ImageService : IImageContract
    {
        const string imageFileName = "image.jpg";

        Image bitmap;

        public ImageService()
        {
            this.bitmap = Image.FromFile(imageFileName);
        }

        public Stream GetImage()
        {
            MemoryStream stream = new MemoryStream();
            this.bitmap.Save(stream, ImageFormat.Jpeg);

            stream.Position = 0;
            WebOperationContext.Current.OutgoingResponse.ContentType = "image/jpeg";

            return stream;
        }
    }


    public interface IImageChannel : IImageContract, IClientChannel { }

    class Program
    {
        static void Main(string[] args)
        {
            string serviceNamespace = "sbDefaultNamespace";
            Uri address = ServiceBusEnvironment.CreateServiceUri("https", serviceNamespace, "Image");

            WebServiceHost host = new WebServiceHost(typeof(ImageService), address);
            host.Open();
            Console.WriteLine("Copy the following address into a browser to see the image: ");
            Console.WriteLine(address + "GetImage");
            Console.WriteLine();
            Console.WriteLine("Press [Enter] to exit");
            Console.ReadLine();
            host.Close();
        }
    }
}


Radhakrishna

Error configuring using Windows Service Bus (1.1) Configuration Wizard

$
0
0

I am trying to Join an existing farm using Service Bus Configuration Wizard. But getting error as shown below:

And the log details says- System.Management.Automation.CmdletInvocationException: Starting service Service Bus Message Broker on machine XYZ-ABC-1234 failed: Time out has expired and the operation has not been completed.

Could anyone please help in fixing this problem. I have already referred Error configuring using Windows Service Bus (1.1) Configuration Wizard


Prince Jain


Partitioned Topics with Filtered Subscriptions

$
0
0
While the MSDN documentation doesn't directly call out that you cannot use a Topic with Partitioning enabled, posts like this one (https://social.msdn.microsoft.com/Forums/azure/en-US/0496dd6a-e6b2-4b63-81c1-56b2ac537f72/the-error-the-operation-is-not-supported-for-an-entity-with-partitioning-enabled?forum=servbus) as well as error messages in Service Bus Explorer via the Exception Message, indicate it is true. I would like clarifying or more concrete documentation on this behavior as I have found it confusing. When I create a Topic and enabled Partitions, using Service Bus Explorer, I cannot create a Subscription with a Filter other than 1=1. Using Powershell, if I try to create a Filtered Subscription (SqlFilter) I also get that same error message. If I use Powershell to mark EnablePartitioning=False, it still shows as True in Service Bus Explorer however I can then add a Filtered Subscription which seems to be working just fine. Can anyone help to add color to this topic?

Allan

The namespace 'Notifications' does not exists in the namespace Microsoft.ServiceBus

$
0
0

I was getting started to make use of the notification hubs and got stumbled in the first step itself.  I am creating a console application to push out notifications. 

I added ServiceBus reference using the package manger console.

Install-PackageWindowsAzure.ServiceBus

I added the reference 

  1. usingMicrosoft.ServiceBus.Notifications;

 Then i end up with the error "The namespace 'Notifications' does not exists in the namespace Microsoft.ServiceBus". 

 I am unable to decipher what is the issue here. I am using .net  framework 4.5

Service bus relay NetTcpRelayBinding works but BasicHttpRelayBinding does not

$
0
0

I am trying out the service bus relay and when I use the following code at the server end it works fine.

host.AddServiceEndpoint( typeof(IMyServiceInterface), new NetTcpRelayBinding(), ServiceBusEnvironment.CreateServiceUri("sb", "<<mynamespace>>", ServiceName)) .Behaviors.Add(new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("RootManageSharedAccessKey", "<<mykey>>") });

// This works

host.Open();

When I try the following code it fails after a while with the error "The request has timed out after 00:00:00 milliseconds. The successful completion of the request cannot be determined. Additional queries should be made to determine whether or not the operation has succeeded".  It also fails in the same way if I use "https".  Also the 00:00:00 time is wrong, it takes a minute or so to timeout.

host.AddServiceEndpoint( typeof(IMyServiceInterface), new BasicHttpRelayBinding(), ServiceBusEnvironment.CreateServiceUri("http", "<<mynamespace>>", ServiceName)) .Behaviors.Add(new TransportClientEndpointBehavior() { TokenProvider = TokenProvider.CreateSharedSecretTokenProvider("RootManageSharedAccessKey", "<<mykey>>") });

// Fails here after a delay

host.Open();

Why does the first one work and not the other?

Why would I want to use BasicHttpRelayBinding instead of NetTcpRelayBinding?  I assume I need to use BasicHttpRelayBinding because this will use port 80 or 443 which is more likely to get it out from behind a firewall.  I assume NetTcpRelayBinding uses some other ports but I have read conflicting things about that.


How to send data to EventHub using Powershell

$
0
0

Hi Expert,

I struggled to send data to an EventHub using Powershell. I hope someone can help me.

First: documentation here from MSbut i think I really did not understand ;(

Second: below the code I used

#################################
# API method
$method = "POST"

# API header
$headers = @{
            "Authorization"="SharedAccessSignature sr={my namespace here}.servicebus.windows.net&sig={my key here}&se=1444603552&skn=RootManageSharedAccessKey";"Content-Type"="application/atom+xml;type=entry;charset=utf-8";"Host"="{my name space here}.servicebus.windows.net";"ContentLength" = "42"
            }

# generate the API URI
$URI = "https://{my namespace here}.servicebus.windows.net/{my event hub name here}/messages?timeout=60&api-version=2014-01 HTTP/1.1"



# create Request Body - What i missed here ???
# $body = { "DeviceId":"dev-01", "Temperature":"37.0" }


# execute the Azure REST API
Invoke-RestMethod -Uri $URI -Method $method -Headers $headers -Body $body 

On computer i added my azure account and already import azure published settings.

Problem: i always get error 401 Remote server  not authorized.

Did you experience such error ? Maybe you will catch quickly what i missed or typed wrong.

Regards,

Terry

IoT Hub FeedbackReceiver

$
0
0

If you have an IoT Hub and you send messages to a device you can have a FeedbackReceiver to request delivery acknowledgement, like described in : https://azure.microsoft.com/en-us/documentation/articles/iot-hub-csharp-csharp-c2d/#receiving-delivery-feedback

If you have multiple WorkerRole instances sending messages to a device how do you handle the feedbackReceiver.CompleteAsync()?

What if the feedbackBatch contains feedback from a message send by Instance 1 and also feedback from a message send by Instance 2? I tried to create a new feedbackBatch with only the records the specific instance has send and call CompleteAsync with this new batch, but then I get some Lock-Exception.

Viewing all 1916 articles
Browse latest View live


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