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

NotSupportedException when using Event Hub

$
0
0

We are trying to evaluate the Event Hub service but having trouble using it. Weather we are trying to send to the Event Hub or read from the Event Hub we get the same exception:

System.NotSupportedException was caught
  HResult=-2146233067
  Message=The requested protocol version 'AMQP 3 1.0.0' is not supported. The supported version is 'AMQP 0 1.0.0'.
  Source=Microsoft.ServiceBus

The code used in this example is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Threading;
using Microsoft.ServiceBus.Messaging;

namespace SB_Test
{
    class Program
    {
        static string eventHubName = "{name of the event hub used goes here}";
        static string connectionString = "{our Connection string goes here";

        static void SendingRandomMessages()
        {
            var eventHubClient = EventHubClient.CreateFromConnectionString(connectionString, eventHubName);
            while (true)
            {
                try
                {
                    var message = Guid.NewGuid().ToString();
                    Console.WriteLine("{0} > Sending message: {1}", DateTime.Now, message);
                    eventHubClient.Send(new EventData(Encoding.UTF8.GetBytes(message)));
                }
                catch (Exception exception)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("{0} > Exception: {1}", DateTime.Now, exception.Message);
                    Console.ResetColor();
                }

                Thread.Sleep(200);
            }
        }

        static void Main(string[] args)
        {
            Console.WriteLine("Press Ctrl-C to stop the sender process");
            Console.WriteLine("Press Enter to start now");
            Console.ReadLine();
            SendingRandomMessages();
        }
    }
}

(This code is picked up from Get started with Event Hubs )

We have tryed with and without appending

;TransportType=Amqp

to the Connections string but the result is the same.

This exception started to show up just 2-3 Days ago. Before it was possible to send messages to the Event Hub without the exception.

Thanks in advance for any input on this that can help us to resolve the issue.

Kind Regards

 - Stefan


Viewing all articles
Browse latest Browse all 1916

Trending Articles



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