Saturday February 04, 2017

.NET Applications and Artemis with AMQP

My first draft for this blog had a very extensive introduction about AMQP, its benefits, how business manager X would preserve its investment and blablablablaba...

Lets say I cut all that #@!# and I'm jumping right to the good stuff:

AMQP is cool, full of Libraries that you can bring to use with ActiveMQ Artemis.

One of the Libraries you can use is the AMQPLite with .NET

If you just want to read the code, i have recently added the .NET Example on Artemis, which is pretty much what I'm describing here

Let me give you a cooking recipe on how to write a .NET application and Apache ActiveMQ Artemis

Let's do it!

Step 1 - Install .NET

There is this fun video explaining how to do it. My teenager daughter would definitely be able to follow this:

There is also a video showing how to do it on Mac and Linux

Step 2 - Write the code

I basically followed the steps here on this hello world app:

The main pitfall I had since I was very rusty on .NET was to install the library accordingly:

But I reckon it was my fault, although I could fix it in 10 min by adding this to the project.json:

"dependencies": {"AMQPNetLite": "1.2.2"},
Here is the code I have:
using System;
using Amqp;
namespace ConsoleApplication
    public class Program
        public static void Main(string[] args)
             string address = "amqp://a:a@localhost:5672";

            Connection connection = new Connection(new Address(address));
            Session session = new Session(connection);
            SenderLink sender = new SenderLink(session, "test-sender", "q1");

            Message message1 = new Message("Hello AMQP!");

            Console.WriteLine("Message sent into queue q1");

Step 3 - Create an Artemis Broker and run it

./artemis create /tmp/myBroker

./artemis create /tmp/mybroker
Creating ActiveMQ Artemis instance at: /private/tmp/mybroker

--user: is a mandatory property!
Please provide the default username:

--password: is mandatory with this configuration:
Please provide the default password:

--role: is a mandatory property!
Please provide the default role:

--allow-anonymous | --require-login: is a mandatory property!
Allow anonymous access? (Y/N):

Auto tuning journal ...
done! Your system can make 25 writes per millisecond, your journal-buffer-timeout will be 40000

You can now start the broker by executing:  

   "/private/tmp/mybroker/bin/artemis" run

Or you can run the broker in the background using:

   "/private/tmp/mybroker/bin/artemis-service" start

Finally: run the thing:

# this will install dependencies
dotnet restore

log  : Restoring packages for /work/apache/six/artemis-distribution/target/apache-artemis-2.0.0-SNAPSHOT-bin/apache-artemis-2.0.0-SNAPSHOT/examples/dotnet/amqp/queue/project.json...
log  : Writing lock file to disk. Path: /work/apache/six/artemis-distribution/target/apache-artemis-2.0.0-SNAPSHOT-bin/apache-artemis-2.0.0-SNAPSHOT/examples/dotnet/amqp/queue/project.lock.json
log  : /work/apache/six/artemis-distribution/target/apache-artemis-2.0.0-SNAPSHOT-bin/apache-artemis-2.0.0-SNAPSHOT/examples/dotnet/amqp/queue/project.json
log  : Restore completed in 741ms.

# this will run the code
dotnet run

Project dotnet (.NETCoreApp,Version=v1.1) will be compiled because expected outputs are missing
Compiling dotnet for .NETCoreApp,Version=v1.1

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:00.9060278

Message sent into queue q1

All of this can be done with both Artemis and ActiveMQ Classic

AMQP is a quite powerful and you can reuse your client libraries any way you want.


great article

Posted by Rajapriya on February 20, 2017 at 05:57 AM UTC #

AMQP is a quite powerful and you can reuse your client libraries any way you want

Posted by free v bucks boost on January 10, 2019 at 08:48 PM UTC #

Hi there. Thanks for the great article. Find me here

Posted by nicfaust on February 15, 2019 at 12:34 PM UTC #

Great Article… Here you can get latest IT Certification Exams Study Material. We provide you real exam questions, dumps, braindumps, along with an updated vce test software. We assure you will pass your exam in first attempt. 100% passing guarantee

Posted by KillerDumps on February 18, 2019 at 11:11 AM UTC #

Finally, the latest *New Method* Fortnite Free V Bucks that you have been searching for is here. This is the only hack that has been updated and is currently the only one that actually works.

Posted by fortnite v buckshack on March 16, 2019 at 11:14 AM UTC #

I never read such detail oriented guide for configuration of Apache server as well as reporting the bugs. I am running my website on Apache server and amazed to see the results through being very responsive.

Posted by Mike on May 18, 2019 at 05:23 AM UTC # [url=]ding a ling[/url] Google

Posted by messy tyagi on June 08, 2019 at 05:14 AM UTC #

Looking for Technical Support, visit on:

Posted by Technical Support on June 08, 2019 at 05:17 AM UTC #

Looking for Technical Support, visit on:

Posted by messy tyagi on June 08, 2019 at 10:53 AM UTC #

Great Article…Thanks!!

Posted by white teeth on June 14, 2019 at 11:29 PM UTC #

AMQP is a quite powerful and you can reuse your client libraries any way you want. thanks!

Posted by hair loss on June 14, 2019 at 11:34 PM UTC #

finally done with step 3 create an Artemis Booker and run it..thanks!

Posted by vbucks on June 21, 2019 at 11:02 AM UTC #

Perder peso puede parecer abrumador: debe descubrir cómo comer de manera saludable y alimentar su cuerpo adecuadamente, planificar un régimen de ejercicios que funcione para usted, dormir lo suficiente y, finalmente, tomar cientos de opciones cada día que lo acerquen más. tu objetivo o te tirará completamente fuera de pista.

Posted by David Summerbell on June 23, 2019 at 05:14 AM UTC #

How to connect to Artemis Active MQ via SSL/TLS from a .NET Client. Would there be a need for the Client to store certificates?

Posted by artemis-user on June 26, 2019 at 07:42 PM UTC #

But I reckon it was my fault, although I could fix it in 10 min by adding this to the project.json:

Posted by film izle on June 29, 2019 at 08:49 PM UTC #

Great Article. Finlly done with step 3 create an Artemis Booker

Posted by Roblox Hack on June 30, 2019 at 12:12 AM UTC #

Thank you @Scott Lewis and @Louise Damiano, really appreciate your comments! Wow another interesting project. I love your style Oleg. It's an art

Posted by exrabthyla1986 on July 20, 2019 at 04:54 PM UTC #

Sometimes low poly modelling and paper design look like being used as a shortcut to save time. In your creation it doesn't feel like that at all. Great work! Nice work, congratulations

Posted by manglitdaephe1986 on July 20, 2019 at 05:34 PM UTC #

stylish work ❤❤❤ So great, just love it!!

Posted by congjukinco1979 on July 20, 2019 at 05:55 PM UTC #

This whole campaign is incredible, great work. You slapped me back and forth in time!

Posted by fuddnunlani1984 on July 20, 2019 at 06:26 PM UTC #

Amazing! Love it! Nice, they are renders, right?

Posted by jadbvilkeygreen1986 on July 20, 2019 at 07:54 PM UTC #

哇,你用的什么笔刷呀! Man, come on! What a stunning images! Unbelievable! Very nicely done @Evgeny Kazantsev ! Congrats!

Posted by brevciopayhou1982 on July 20, 2019 at 11:36 PM UTC #

Brutal chicos!! Vaya curro que hay detrás, pero ha valido la pena! LOVE THE COLOR MATCH

Posted by odteosuwem1970 on July 21, 2019 at 12:26 AM UTC #

Pd: ojo con "Desicions" en la tercera lámina. Wooow!

Posted by temissselbchip1982 on July 21, 2019 at 01:31 AM UTC #

跪了,nice!amazing! Thanks a lot @Paulise Photography

Posted by fiseluron1982 on July 21, 2019 at 03:11 AM UTC #

Man You are my god now! Absoloutely mind blowing! 应用到现代餐饮空间 做个清新日式风也不错

Posted by granewaman1984 on July 21, 2019 at 04:53 AM UTC #

I like how it looks almost grainy in texture, nice work. Thank you @Suvo Roy @marcos gonzales !

Posted by steltiotecsio1986 on July 21, 2019 at 05:26 AM UTC #

that is freaky cool! @Viktor Dobras hahaha! thanks

Posted by asathplumchard1979 on July 21, 2019 at 06:39 AM UTC #

@Alphonsie Nicolas Thank you so much Alphonsie! it is very beautiful and unusual

Posted by egpuncapan1988 on July 21, 2019 at 07:12 AM UTC #

So cool!!!! @Luiz Ramos thank you :)

Posted by versriporsi1987 on July 21, 2019 at 08:16 AM UTC #

Sooooo Cuuuuuuuute~~~~~!Love~~~the best! :) Clean work !

Posted by guitideskcrin1973 on July 21, 2019 at 09:54 AM UTC #

Mind bending! Love it! Wonderful illustrations, great work!

Posted by zsubcampvafin1985 on July 21, 2019 at 10:27 AM UTC #

Right and this is so cool :) Vontade de dar um abraço em toda equipe!

Posted by vislilisi1977 on July 21, 2019 at 11:00 AM UTC #

Mind blowing article! Thank you so much

Posted by Numerology Signs on July 28, 2019 at 11:18 AM UTC #

het yr v bckd

Posted by freevbuck on August 09, 2019 at 12:49 AM UTC #

get v bucks now easy

Posted by vbucksfree on August 10, 2019 at 03:36 AM UTC #

Encountering issues or errors while using Lexmark printer? Dial the Lexmark printer toll-free phone number and get instant 24/7 support from the Lexmark printer customer service.

Posted by Lexmark Printer Support on August 20, 2019 at 12:33 PM UTC #

Thank you for this wonderful hope you check this one too.

Posted by John Cena on August 27, 2019 at 01:04 PM UTC #

Our approach towards providing residents and businesses with the highest quality property maintenance services is pretty straightforward – it’s about competence, integrity and trust This is what you’ll get at MIB regardless the size of your job.

Posted by John on August 28, 2019 at 04:51 PM UTC #

We have massive experience in managing numerous clients. They come to us with issues for various items and brands. Our trade and IT experts take care of those issues efficiently. So whenever you want to remove a technical glitch, you must ask for our support. Now check our list below and know, which type of issues we resolve? Geek Squad Tech Support executives take care of your faulty smartphone. Different brand, processor or the operating system doesn’t matter for us. Having certified technicians from all the popular brands across the world we can resolve anything and everything related to your smartphone. Geek Squad Tech Support has developed specific techniques to troubleshoot your mobile within a couple of hours.

Posted by Sam Smith on October 03, 2019 at 04:09 AM UTC #

Post a Comment:
  • HTML Syntax: NOT allowed



Hot Blogs (today's hits)

Tag Cloud