Code Monkey home page Code Monkey logo

Comments (6)

gzoller avatar gzoller commented on August 22, 2024

Ok, so playing with this some more...

Attempt #1) Assume queues are auto-declared internally (some code seems to imply maybe)

AckedSource(List("message 1","message 2"))
            .map(Message.queue(_,"testQ"))
            .to(MessagePublisherSink(rabbitControl))
            .run

This did... nothing. No error messages given. testQ not auto-created, so no content in RabbitMQ.

Attempt #2) Manually create testQ in Rabbit web Admin first, then run code in #1 above.

This did... nothing, which I found surprising. I thought that would work.

Attempt #3) Manually create testQ as before but this time run:

rabbitControl ! Message.queue("Testing 1,2,3", queue = "testQ")

This added 1 message to testQ!

So I guess I still need to know how to declare queues in this framework, as well as why #2 didn't work, as this is pretty much lifted from the docs. My successful test #3 proves I'm connected to RabbitMQ and able to communicate with it.

from op-rabbit.

timcharper avatar timcharper commented on August 22, 2024

Queues are declared by the consumers.

There's a mechanism to have message publishers declare queues / exchanges. I'll respond more in a bit.

Sent from my iPhone

On Oct 16, 2015, at 16:28, Greg Zoller [email protected] wrote:

Ok, so playing with this some more...

Attempt #1) Assume queues are auto-declared internally (some code seems to imply maybe)

AckedSource(List("message 1","message 2"))
.map(Message.queue(_,"testQ"))
.to(MessagePublisherSink(rabbitControl))
.run
This did... nothing. No error messages given. testQ not auto-created, so no content in RabbitMQ.

Attempt #2) Manually create testQ in Rabbit web Admin first, then run code in #1 above.

This did... nothing, which I found surprising. I thought that would work.

Attempt #3) Manually create testQ as before but this time run:

rabbitControl ! Message.queue("Testing 1,2,3", queue = "testQ")
This added 1 message to testQ!

So I guess I still need to know how to declare queues in this framework, as well as why #2 didn't work, as this is pretty much lifted from the docs. My successful test #3 proves I'm connected to RabbitMQ and able to communicate with it.


Reply to this email directly or view it on GitHub.

from op-rabbit.

gzoller avatar gzoller commented on August 22, 2024

There's much I don't understand. I did kludge together a way to declare queues. Not sure if its the right thing...seems pretty involved, but it did appear to work:

    val connectionActor = await((rabbitControl ? RabbitControl.GetConnectionActor).mapTo[ActorRef])
    val channelCreated = await((connectionActor ? CreateChannel(ChannelActor.props(), None)).mapTo[ChannelCreated])
    channelCreated.channel ! ChannelMessage { _.queueDeclare("testQ",true,false,false,null) }
    system.stop(channelCreated.channel)

from op-rabbit.

timcharper avatar timcharper commented on August 22, 2024

from op-rabbit.

gzoller avatar gzoller commented on August 22, 2024

My consumers and producers are different processes and both will likely use the same libraries.

So basically my consumers may come online first in a system of many moving pieces.

Sent from my iPhone

On Oct 18, 2015, at 10:18 PM, Tim Harper [email protected] wrote:

Is there a reason you can't just have your consumers idempotently declare
the queues / bindings?

Reply to this email directly or view it on GitHub.

from op-rabbit.

timcharper avatar timcharper commented on August 22, 2024

OK, then it is completely possible to have your producers declare the Queue/binding if they don't already exist on first message sent.

Just have your publisher use the same object as the consumer binds to. Be sure to reuse the publisher. Otherwise it will re-declare on every message send.

Sent from my iPhone

On Oct 19, 2015, at 13:13, Greg Zoller [email protected] wrote:

My consumers and producers are different processes and both will likely use the same libraries.

So basically my consumers may come online first in a system of many moving pieces.

Sent from my iPhone

On Oct 18, 2015, at 10:18 PM, Tim Harper [email protected] wrote:

Is there a reason you can't just have your consumers idempotently declare
the queues / bindings?

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

from op-rabbit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.