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

Microsoft.ServiceBus.Messaging.EventProcessorHost ver 2.0.5 problem

$
0
0

Hello,

I just wasted hours with a FileNotFoundException (EventProcessorHost .dll or dependencies) in a very simple example Project, that uses EventProcessorHost in Version 2.0.5.

I had no idea if the problem is because I use a Worker Role, or maybe because I use an IoT Hub instead of Event Hub and when I was very desperate I tried a different Version (one step back to 2.0.4) and it worked.

I feeled to inform you because I guess I'm not the only one that would like to use EventProcessorHost with IoT Hub


WebJobs ServiceBusTrigger parameter function not found

$
0
0

Hello,

public class Program {    public static void Main()    {        var host = new JobHost();        host.RunAndBlock();    }    public static void ProcessMessage([ServiceBusTrigger("Topic""Subscription")] BrokeredMessage message)    {        //TO DO(message);    } }

I am running code Local m/c.       

In above code I am trying to trigger Topic's subscription on entry.

but when I run Code It gave me error "No Functions Found. Try making job classes and methods public".

I tried same method  in Function.cs file, but doesn't work.  

But when I changed ServiceBusTrigger to QueueTrigger It worked.

I have set below config properly.

<add name="AzureWebJobsDashboard" connectionString="{My Connection string}"/>

<add name="AzureWebJobsStorage" connectionString="{Connection_String}"/>    

<add name="AzureWebJobsServiceBus" connectionString="{Connection_String}"/> 

Where am I getting wrong?

Please help me..

Thanks

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

Service Bus Messaging Protocol

$
0
0

Hi

I am unable to find in any documentation or blogs that whether "Service Bus Messaging Protocol" which is the default protocol for communicating with ServiceBus happens over SSL or not?

I know it is a TCP connection but over SSL or not is the answer I am looking for?

Thanks for the help.

Piyush


Piyush Gupta

any idea why I'm getting strange sequence numbers from service bus subscriptions?

$
0
0

FromMarc Obaldo@mobaldo via Twitter

 

Hi @Azure, any idea why I'm getting strange sequence numbers from service bus subscriptions? #Azure #ServiceBus

Twitter link: https://twitter.com/mobaldo/status/664451803354824704

 

Thanks,

@AzureSupport

 

Python AMQP authentication for topics

$
0
0

Hi!

I have been trying to get AMQP work from Python (in ubuntu) to Azure bus service topics.

I installed the following packages:

https://pypi.python.org/pypi/qpid-python
https://pypi.python.org/pypi/python-qpid-proton/0.10

Openssl has also been installed.

I am able to import libraries ok but I am having troubles with the authentication. There is e.g. the following document describing the address supposed to be used with subscribe method.

https://azure.microsoft.com/en-us/documentation/articles/service-bus-amqp-python/

The document uses terms:

-username

-password

Some older documentation refers to the connection string like:

amqps://[issuer-name]:[issuer-key]@[namespace].servicebus.windows.net

However, all of the above seems to be outdated. So how the connection string to the subscribe method should actually be generated:

username =-> policy_name ??

password ==> URL encoded Shared Access Signature??

Shared access signature for the the root key is in form (part of the key removed):

'SharedAccessSignature sr=sb%3A%2F%2Ftrenissian.servicebus.windows.net%2F&sig=hnh6Yn1nb%2.....2BhKPPlEG2fwqsk%3D&se=1447334425&skn=RootManageSharedAccessKey'

and URL encoded version of the connection string to subscribe method is in form of (part of the key removed):

amqps://RootManageSharedAccessKey:SharedAccessSignature+sr%3Dsb%253A%252F%252Ftrenissian.servicebus.windows.net%252F%26sig%3Dhnh6Yn1nb....2BhKPPlEG2fwqsk%253D%26se%3D1447334425%26skn%3DRootManageSharedAccessKey@trenissian.servicebus.windows.net/topic_antti_02/Subscriptions/subs_high_antti_02

I have been trying numerous combinations, but none of them seems to work. Traffic to topics and subscriptions with Python SDK using http works just fine.

Do you have up to date documentation that has working example?

BR, Antti

Can we Connect directly the Azure Event Hub With Azure Notification Hub?

$
0
0
 I have sent message to Azure Event Hub through C# Application.After i send the message to Event Hub ,it will be given as input to the Azure Stream analytics and Process some Events and sent back to Event Hub as an output of Azure Stream Analytics.Now I want to sent the Notification to the Mobile App through Notification Hub of Azure after receiving the Event hub's Output.

How can i connect azure event hub and notification hub now?

Azure Service Bus Topics & Subscription

$
0
0

Hello,

we are evaluating Message Broker i.e., RabbitMQ & Azure Service Bus  for one of our program.  I see RabbitMQ has feature called Exchange to Exchange binding with filters being configured via routing key. We know conceptually 'Topics' is a equivalent in Azure Service Bus...

Could you clarify whether Exchange to Exchange binding configuration can be done equivalently in Azure Service Bus using Topics?

Thanks,

Satish


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

Service Bus DB names

$
0
0

Is there a way to specify different names for databases SbGatewayDatabase and SbManagementDB at the time of installation and configuration of SB?

Shilpa

Receiving MaximumListenersPerEndpoint:25 or System.ServiceModel.QuotaExceededException for service bus relay - to many listeners

$
0
0

I am using a service bus relay and are receiving the following error

There is only one application connecting to the path, and for some reason the number of listeners has climbed to 25, but there is not 25 listeners.

During testing I am ending the program and likely not calling "close" on the end point, but I would have through that service bus would clean this up.  At any point in time there would only be one active listener on the end-point/path

I am not aware of a way of removing these end points, is there a way of clearing old dead listeners from a service bus?  This now means my service cannot run or connect, and I can't find a way to fix the issue.

System.ServiceModel.QuotaExceededException occurred
  HResult=-2146233087
  Message=MaximumListenersPerEndpoint:25. TrackingId:d79456b4-cf41-4d4e-aa0a-88ccc6b82417_G12,TimeStamp:6/11/2015 4:42:29 AM
  Source=Microsoft.ServiceBus
  StackTrace:
       at Microsoft.ServiceBus.RelayedOnewayListener.RelayedOnewayAmqpListenerClient.AmqpRelayedConnection.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.RelayedOnewayListener.RelayedOnewayAmqpListenerClient.GetOrCreateConnection(Uri via, TimeSpan timeout)
       at Microsoft.ServiceBus.RelayedOnewayListener.RelayedOnewayAmqpListenerClient.Connect(TimeSpan timeout)
       at Microsoft.ServiceBus.RelayedOnewayTcpClient.EnsureConnected(TimeSpan timeout, Boolean isRetry)
       at Microsoft.ServiceBus.RelayedOnewayTcpClient.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.RelayedOnewayListener.OnOpen(TimeSpan timeout)
       at Microsoft.ServiceBus.Channels.RefcountedCommunicationObject.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.RelayedOnewayChannelListener.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.RelayedSocketListener.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.Channels.BufferedConnectionListener.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.Channels.ConnectionAcceptor.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.Channels.ConnectionDemuxer.StartDemuxing(TimeSpan timeout, OnViaDelegate viaDelegate)
       at Microsoft.ServiceBus.Channels.ConnectionDemuxer.Open(TimeSpan timeout)
       at Microsoft.ServiceBus.SocketConnectionTransportManager.OnOpen(TimeSpan timeout)
       at Microsoft.ServiceBus.Channels.TransportManager.Open(TimeSpan timeout, TransportChannelListener channelListener)
       at Microsoft.ServiceBus.Channels.TransportManagerContainer.Open(TimeSpan timeout, SelectTransportManagersCallback selectTransportManagerCallback)
       at Microsoft.ServiceBus.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
       at Microsoft.ServiceBus.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout)
       at Microsoft.ServiceBus.SocketConnectionChannelListener`2.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ReliableChannelListenerBase`1.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.ReliableListenerOverDatagram`4.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open()
       at ServiceBusManager.WCFEndPointManagement`2.StartServer()
  InnerException: Microsoft.ServiceBus.Messaging.Amqp.AmqpException
       HResult=-2146233088
       Message=MaximumListenersPerEndpoint:25. TrackingId:d79456b4-cf41-4d4e-aa0a-88ccc6b82417_G12,TimeStamp:6/11/2015 4:42:29 AM
       Source=Microsoft.ServiceBus
       StackTrace:
         Server stack trace:
         Exception rethrown at [0]:
            at Microsoft.ServiceBus.Common.ExceptionDispatcher.Throw(Exception exception)
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Amqp.AmqpObject.EndOpen(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Amqp.DuplexAmqpLink.OnOperationComplete(AmqpObject link, IAsyncResult result, Boolean isOpen)
         Exception rethrown at [1]:
            at Microsoft.ServiceBus.Common.ExceptionDispatcher.Throw(Exception exception)
            at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result)
            at Microsoft.ServiceBus.Messaging.Amqp.AmqpObject.EndOpen(IAsyncResult result)
            at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
       InnerException:


matvdl

Service Bus vNext roadmap?

$
0
0
It has been over a year since Service Bus 1.1 was released for Windows.  Is there a timeframe we can expect to see an update for this? Really looking forward to bringing some of the Azure-only features to Windows. ahem, relays.

Service Bus namespace with ACS authentication problem

$
0
0

Hi everyone!

I've created a Service Bus namespace with support for ACS authentication/authorization.
Unfortunately I wasn't able to use the namespace using this method. Every time I try any kind of operation anUnauthorizedAccessException is thrown.
It comes with additional information that reads:

"The token provider was unable to provide a security token while accessing 'https://<namespace>sb.accesscontrol.windows.net/WRAPv0.9/'"
(...)
"Token provider returned message: 'Error:Code:401:SubCode:T2002:Detail:Audience not valid.'"

Here's what the source code looks like:

using Microsoft.ServiceBus

// (...)

static void Main(string[] args)
{
	var serviceNamespace = "<namespace name>";
	var issuerName = "owner";
	var issuerSecrete = "<default key provided in SB and ACS control panels>";

	string accessToken = RequestAccessToken (serviceNamespace, issuerName, issuerSecrete);

	var tokenProvider = TokenProvider.CreateSimpleWebTokenProvider (accessToken);
	var namespaceUri = ServiceBusEnvironment.CreateServiceUri ("sb", serviceNamespace, string.Empty);
	var namespaceManager = new NamespaceManager (namespaceUri, tokenProvider);

	namespaceManager.CreateQueue("q1");

	return;
}

static string RequestAccessToken (string serviceNamespace, string issuerName, string issuerSecrete)
{
	var AcsEndpoint = string.Format(
		"https://{0}-sb.accesscontrol.windows.net/WRAPv0.9/", serviceNamespace
		);
	var realm = string.Format ("http://{0}.servicebus.windows.net/", serviceNamespace
		);

	NameValueCollection identityParameters = new NameValueCollection();
	identityParameters.Add("wrap_scope", realm);
	identityParameters.Add("wrap_name", issuerName);
	identityParameters.Add("wrap_password", issuerSecrete);

	var client = new WebClient();
	byte[] AcsResponse = client.UploadValues(AcsEndpoint, identityParameters);
	string AcsResponseStr = Encoding.UTF8.GetString(AcsResponse);

	string token = AcsResponseStr
				.Split('&')
				.Single(value => value.StartsWith("wrap_access_token=", System.StringComparison.OrdinalIgnoreCase))
				.Split('=')[1];

	string decodedToken = System.Net.WebUtility.UrlDecode(token);
	return decodedToken;
}

The RequestAccessToken call is always successful and returns a token which then I use feed theTokenProvider.
So everything looks fine until I call any kind of function which needs to manage, send or consume data from the namespace.
I've no idea what the problem is... The Audience looks pretty much valid to me in the ACS token (every time I test the audience is exactly the same as the Realm).

Do you have any idea of that the problems might be?
I'm under the feeling I missed something :(

Thank you very much!


Proper use in notification hub

$
0
0

Hello everyone, I have a problem, I would be happy if someone knowledgeable to help me.

I am a software developer in Xamarin - Android, I want to create notification messages. For this purpose I use Azure notification hub, combined with Google's service - Google Cloud Messaging (GCM).

My problem comes when I want to send notification to a particular user. I realized that I need to use the "TAGS" When I compose a new user to the system (Uniqe TAG)

Indeed, it works great, but when the user logged off his account, and then connect to another one (with another TAGS) - the TAGS of his old account are kept in a certain time, and he continues to receive personal messages from the previous account!!!!

Does anyone know what can be done about it?

thank you very much, I absolutely enjoy using your forums

Session aware Subscriptions - receive messages using Node SDK

$
0
0

Using the receiveSubscriptionMessage in Node.js SDK, in a session enabled subscription, does it lock the session messages so it doesn't get picked up by other workers?

Is there another way i'm missing?


You could edit Data in event hub Azure ?

$
0
0

I'm new in Azure

I need to update the data in the event hub Microsoft Azure

can I do that?

this my code to send data 

https://stackoverflow.com/questions/33753349/how-can-i-update-data-in-event-hub-microsoft-azure

any suggestion

thanks.




OnMessage and lock expired message with multiple consumers

$
0
0

Hi,

I'm venturing into this are and created a sample solution with 1 pulisher console app which adds to the queue, and 1 consumer which implements the OnMessage callback to recieve the items.

When i spin up multiple instances of the consumer console app i can see they are all picking up items from the queue but i get alot of "The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue" errors.

Sometimes i can see in the consumer console output that different consumers pick up the same message which i thought shouldnt be happening. In this case if 2 queues pick up the same item then try executing db calls/web service calls and so on. then one finishes, when the other tries to call CompleteAsync it'll throw exception because the item is already removed from the queue, but my logic has already been executed.

Any help/comments/suggestions are appreciated.

Here is the test code i'm using:

Publisher:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Description;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;

namespace QueuePublisher
{
    class Program
    {
        private static string connectionString;
        private static NamespaceManager namespaceManager;
        private static string queueName = "TestQueue";

        static void Main(string[] args)
        {
            try
            {
                InitializeAzureQueue();
                SendMessageToQueue();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }

        public static void InitializeAzureQueue()
        {
            connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
            namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
            CreateTestQueue(queueName);
        }

        public static void CreateTestQueue(string name)
        {
            QueueDescription qd = new QueueDescription(name)
            {
                MaxSizeInMegabytes = 5120,
                DefaultMessageTimeToLive = new TimeSpan(0, 1, 0),
                LockDuration = new TimeSpan(0, 5, 0)
            };

            if (!namespaceManager.QueueExists(name))
            {
                namespaceManager.CreateQueue(qd);
            }
        }


        public static void SendMessageToQueue()
        {
            var client = QueueClient.CreateFromConnectionString(connectionString, queueName);

        MessageCountDetails:
            Console.WriteLine("Please enter the number of messages to send:");

            var line = Console.ReadLine();
            if (line.ToLower() == "q") return;

            int value = 0;
            if (int.TryParse(line, out value))
            {
                Console.WriteLine("Creating {0} messages...", value);
            }
            else
            {
                goto MessageCountDetails;
            }

            var list = new List<BrokeredMessage>();

            for (int i = 1; i <= value; i++)
            {
                var message = new BrokeredMessage("Test message " + i);
                message.Properties["TestProperty"] = "TestValue";
                message.Properties["Message number"] = i;
                list.Add(message);
            }

            if (list.Any())
            {
                client.SendBatchAsync(list);
            }

            Console.WriteLine("{0} - Sent {1} messages to the {2} queue", DateTime.Now.ToString(), list.Count, queueName);
            goto MessageCountDetails;
        }
    }
}

Consumer:

using System;
using Microsoft.Azure;
using Microsoft.ServiceBus.Messaging;

namespace QueueConsumer
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
                QueueClient Client = QueueClient.CreateFromConnectionString(connectionString, "TestQueue");

                // Configure the callback options.
                OnMessageOptions options = new OnMessageOptions();
                options.AutoComplete = false;
                options.AutoRenewTimeout = TimeSpan.FromMinutes(1);

                Client.OnMessageAsync(async msg =>
                {
                    bool shouldAbandon = false;
                    try
                    {
                        Console.WriteLine("ThreadId: {0}, MessageId:{1}, Body{2}, TestProperty:{3}",
                           System.Threading.Thread.CurrentThread.ManagedThreadId,
                           msg.MessageId,
                           msg.GetBody<string>(),
                           msg.Properties["TestProperty"]);

                        //TODO: at this point do the message processing logic
                        // - eg. db calls, web service calls etc.

                        await msg.CompleteAsync();

                    }
                    catch (Exception ex)
                    {
                        shouldAbandon = true;
                        Console.WriteLine("ThreadId: {0}, Error: {1}", System.Threading.Thread.CurrentThread.ManagedThreadId, ex.Message);
                    }
                    finally
                    {
                        await msg.AbandonAsync();
                    }
                });

            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(ex);
            }

            Console.ReadKey();
        }
    }
}



How To Undo The Received Messages From Service Bus Explorer

$
0
0

Hi,

Accidentally, I used the option "Receive Messages" instead of "Peek Messages" in Service Bus Explorer. I can not see those messages now.

Is there any way to get those messages back ? Please guide.

Client/Server Queue Architecture/Design?

$
0
0

I have a client/server application where the client submits long-running jobs. The way I'm designing this, the client would upload a blob to storage and then queue a message with the blob identifier.  Workers on the server side would process the job and report on progress via a queue.  What I'm trying to figure out is if all jobs should report on progress to the same queue, or if each job should get its own "response queue".  Is it expensive in any way to create/delete queues?  What concerns me is that I don't think clients should be listening to (even getting and filtering) responses from all jobs.  So, I'm leaning toward a slightly tweaked process:  the client uploads a blob, creates a queue with the same name, starts listening to that queue, and then queues a message to the server.  The worker processes the blob and sends responses on the new queue.  When the job is complete, the client deletes the queue.  Is that a reasonable approach?

Any ideas or thoughts appreciated.

Thanks!

Brad.

Service Bus relay - WCF service hosted through a Windows Service

$
0
0

Hi All

I'm using a service bus relay to communicate with a WCF service hosted on-premise. The relay works absolutely fine when I use VS to host the WCF service through a console application and I'm able to consume the services, however when I use Windows Service to host the WCF service I'm not able to create the service bus relay ( not able to view it on the azure portal as well ). Could you point me to an article which deals with the same or help me identify the issues. I've followed the due process necessary to host a WCF service using Windows Services.

Viewing all 1916 articles
Browse latest View live


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