Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Red Hat Enterprise Linux, DNX, and Azure Service Bus

August 17, 2016
Andrew Male
Related topics:
Linux.NET
Related products:
Red Hat Enterprise Linux

    Service Bus is, according to Microsoft, “...a generic, cloud-based messaging system for connecting just about anything.” Most commonly used as an Azure service, it can be an excellent tool for managing non-critical workloads within an application and offers the benefit of being AMQP compatible when compared to Amazon’s SQS. Connecting to Service Bus (SB) on Windows is simple, but will the new .NET Core (DNX) platform be capable of the task?

    Library Adventures

    As of the writing of this post, Microsoft hasn’t yet released an updated version of its Azure Service Bus tools that is compatible with DNX. Thankfully, the AMQP compatibility makes it easy for libraries to be built that don’t depend on Microsoft.

    After a bit of searching, I was able to find just such a library, AzureSBLite, by Paolo Patierno (who unsurprisingly appears to be a member of the RedHat organization on GitHub). The library doesn’t explicitly state it is compatible with DNX, but I figured I’d give it a shot regardless.

    A bit of trial and error led me through the following missteps:

    • Had to make sure the https://api.nuget.org/v3/index.json NuGet feed was added to my ~/.nuget/NuGet/NuGet.Config feed list
    • Had to add the AmqpNetLite dependency to my project.json dependencies:
      • “AmqpNetLite”: { “version”: “1.1.9-rc” }

    Short and sweet, the library was compiling and ready for me to build code against.

    The Code

    I added a Program.cs file to the project and threw together my code. I won’t go through every single line, but there are certainly a few things to note:

    • SBConnStr, SBTopicName, and SBTopicSubscriptionName are values I copied directly from the Azure Service Bus management portal, available at: https://manage.windowsazure.com/ (at least while they work on moving it to the new portal)
      • In order to get a topic/subscription option for your SB queue, you’ll need to make sure you have upgraded your SB service to the Standard package instead of the Basic messaging tier
    • You’ll want to be sure you are copying the connection string with information specific to the access policy for your topic/subscription.
    • It seems the client and factory objects in the AzureSBLite library do not currently implement IDisposable; I will likely be submitting a pull request for this myself as I tend to prefer to leave cleanup to the IL compiler instead of trusting myself to call client.Close()
    • The subscription name is only relevant when you begin polling for messages on a topic, so no subscription name is supplied when pushing a message onto the queue.
    • I’ve added a limit to the number of times a queue is polled, but you will likely have different ways you’ll want to handle polling. (There are relevant details on this for pricing of the service, which can be found here.)
    • Don’t forget to mark your received messages as Complete. Not doing so will cause them to be continually consumed by all clients you have connected.

    In the end, the code was fairly straightforward to produce and the library worked perfectly once it was compiling.

    Conclusion

    I’m not sure whether or not Microsoft plans to release a version of the Azure tools for DNX, especially given how they have been supporting the AmqpNetLite project recently that powers AzureSBLite. The good news is that even if they don’t release one, libraries like these make it not only possible but also easy to consume Azure-hosted Service Bus messages anywhere that .NET Core will run.

    For additional information and articles on .NET Core visit our .NET Core web page for more on this topic.

    About Andrew Male

    Andrew Male (@AndyM84) is a senior engineer at an enterprise development company in Boston, MA. Andrew has been programming from a young age and is entirely self-taught; he has spent time in many corners of the programming world including game/VR work, agency work, and teaching development to students and adults alike. He spends most of his time working on architecture design and pursuing his favorite hobby—physics.

    Last updated: September 3, 2019

    Recent Posts

    • MCP servers vs. skills: Choosing the right context for your AI

    • How to route external and local LLMs with Models-as-a-Service

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.