Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 10 | Comments: 33

filter by tags archive

RavenMQ update

time to read 2 min | 372 words

It wasn’t planned so much as it happened, but RavenMQ just slipped into private beta stage. The API is still in a the somewhat clumsy state, but it it is working quite nicely Smile

You can see an example of the client API below:

using(var connection = RavenMQConnection.Connect("http://reduction:8181"))
{
    connection.Subscribe("/queues/abc", (context, message) => 
        Console.WriteLine(Encoding.UTF8.GetString(message.Data)));

    connection.PublishAsync(new IncomingMessage
    {
        Queue = "/queues/abc",
        Data = Encoding.UTF8.GetBytes("Hello Ravens")
    });

    Console.ReadLine();
}

Please note that this is likely to be subject to many changes.

This is written about 10 minutes after I posted the code above:

using(var connection = RavenMQConnection.Connect("http://localhost:8181"))
{
    connection.
        Subscribe<User>("/queues/abc", (context, message) => Console.WriteLine(message.Name));

    connection
        .StartPublishing
        .Add("/queues/abc", new User {Name = "Ayende"})
        .PublishAsync();

    Console.ReadLine();
}

I told you it would change… Open-mouthed smile


Comments

Bryan

I like the subscribe, don't like the publish.

Does it run on mono?

configurator

I don't like the publish either. It should be connection.PublishAsync("/queues/abc", new User { Name = "Ayende" });

Why do you need connection.StartPublishing?

Johannes Gustafsson

Is RavenMQ transactional?

Or a bit more specific: Would you recommend RavenMQ as an nservicebus transport?

Bryan Murphy

I agree with configurator. Anything more than that and it's too much.

JasonWy

Is this going to work with the DTC? How does Ravenmq compare to rabbitmq? If it wil work on the DTC then it will be possible to integrate with nservicebus.

Frank Quednau

You don't have to go into a fit for API. If I'd be using it in the client, I'd probably stick MemBus on top of it and...

bus.Publish(new User {Name = "Ayende"});

...

void Handle(User user) {

RavenMQConnection w/queuename etc.etc.

}

Just wondering how much logic goes into the queue name, if I remember correctly it can be a pretty dynamic thing...

Ayende Rahien

Bryan & configurator,

Yes, it runs on Mono.

And the reason that it needs the StartPublishing code is that we want to make the API very explicit about the way we support sending multiple messages in a single batch

Ayende Rahien

Johannes,

Yes, it is transactional.

And while you could use it as a NSB transport, its main usage scenario is being expose to the actual clients

Mike Brown

Hats off to you man! Every time I visit you've got something amazing going. So did you steal Dumbledore's time turner or just figured out the cloning process. It's hard to believe that it's just you doing all of this.

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

  1. Production postmortem: The case of the memory eater and high load - 3 days from now
  2. Production postmortem: The case of the lying configuration file - 4 days from now
  3. Production postmortem: The industry at large - 5 days from now
  4. The insidious cost of allocations - 6 days from now
  5. Find the bug: The concurrent memory buster - 7 days from now

And 4 more posts are pending...

There are posts all the way to Sep 10, 2015

RECENT SERIES

  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    14 Aug 2015 - The case of the man in the middle
  3. What is new in RavenDB 3.5 (7):
    12 Aug 2015 - Monitoring support
  4. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats