Git Product home page Git Product logo

Comments (9)

syrandel avatar syrandel commented on August 29, 2024

from cfx.

xXSnowBunny avatar xXSnowBunny commented on August 29, 2024

Hi Daniel,

Thank you , that would be awesome! =D .

According to RabbitMQ:

Whenever the broker considers it needs to free up memory, messages from this cache will be paged out to disk. Paging a batch of messages to disk takes time and blocks the queue process, making it unable to receive new messages while it's paging.

Lazy queues attempt to move messages to disk as early as practically possible. This means significantly fewer messages are kept in RAM in the majority of cases under normal operation. This comes at a cost of increased disk I/O.

https://www.rabbitmq.com/lazy-queues.html

By enabling LazyQueue , there will not be a sudden performance drop.

But besides, the lazy queue argument, I would also like to know if I can set the precondition of a queue like; ttl, dead-letter-exchange and etc before I put in the AddSubcribeChannel(uri,queueAddress), because I noticed, that once I created a queue in RabbitMQ with one/more arguments , CFX will not be able to consume the message.

and using AddSubscrbieChannel(uri,"/queue/queueA") will only create a durable queue that do not have any arguments in RabbitMQ if the queue do not exist.

So I had been wondering if CFX only supports consuming messages from a Durable Queue. Please correct me if I am wrong.

Thank you.

Snow Bunny

from cfx.

syrandel avatar syrandel commented on August 29, 2024

from cfx.

simon-smith avatar simon-smith commented on August 29, 2024

from cfx.

xXSnowBunny avatar xXSnowBunny commented on August 29, 2024

Hi Daniel & Simon,

Thank you for your reply.

For now I am just testing the CFX and trying to consume the message from a queue that contains arguments. It do not necessarily need to be a lazy queue, but a queue that contains other arguments. I am considering the lazy queue, in case there are too many messages in which will cause RabbitMQ to start flushing the messages into the disk.

Thank you .

from cfx.

Abhishek150995 avatar Abhishek150995 commented on August 29, 2024

Hi,

theEndpoint.AddSubscribeChannel(new Uri(myBroker), queueAddress); adds a Subscriber to the AMQP.
Which method can be used to receive the message??

Thanks

from cfx.

xXSnowBunny avatar xXSnowBunny commented on August 29, 2024

Hi @Abhishek150995
Thank you for the reply.

Yup , I can subscribe to the queue using the code but that is only if the queue is a durable queue without any arguments set to the queue.

And if I were to use the same code to subscribe to a queue that have arguments, lets say the queue had been pre-created in the RabbitMQ broker with "auto delete = true", then it will not be able to subscribe to the queue.

An error as shown below, will be thrown:

"ERROR establishing connection to queue = PRECONDITION_FAILED - inequivalent arg 'auto_delete' for queue 'queueA' in vhost '/': received 'false' but current is 'true'"

I am wondering if CFX have any parameter where I can use to set the queue arguments as in RabbitMQ Client library which allows me to set the queue arguments before it tries to subscribe to the queue. Its because the queue arguments from CFX Client do not match to the Queue arguments that had been pre-created in the RabbitMQ, so when it tries to establish a connection and subscribe to the queue, it will throw an error.

from cfx.

Abhishek150995 avatar Abhishek150995 commented on August 29, 2024

Hi @Abhishek150995
Thank you for the reply.

Yup , I can subscribe to the queue using the code but that is only if the queue is a durable queue without any arguments set to the queue.

And if I were to use the same code to subscribe to a queue that have arguments, lets say the queue had been pre-created in the RabbitMQ broker with "auto delete = true", then it will not be able to subscribe to the queue.

An error as shown below, will be thrown:

"ERROR establishing connection to queue = PRECONDITION_FAILED - inequivalent arg 'auto_delete' for queue 'queueA' in vhost '/': received 'false' but current is 'true'"

I am wondering if CFX have any parameter where I can use to set the queue arguments as in RabbitMQ Client library which allows me to set the queue arguments before it tries to subscribe to the queue. Its because the queue arguments from CFX Client do not match to the Queue arguments that had been pre-created in the RabbitMQ, so when it tries to establish a connection and subscribe to the queue, it will throw an error.

Thanks for your valuable reply.

Can you share a snippet of your subscriber code?
I am unable to subscribe to the published messages.
AddSubscriber function returns IsOpen=false.
Also can you please explain to me the use if AddListner function?

Thanks again.

from cfx.

StevenAZy avatar StevenAZy commented on August 29, 2024

Hi,

I am new in CFX and RabbitMQ.
I had followed the tutorial on both the CFX and also the RabbitMQ to publish and consume messages.

My broker is setup as follows.

  1. I had manually created my exchange, queue and bindings in RabbitMQ Broker =
    exchangeA -> routingKeyA -> queueA (Durable queue , without any additional arguments parameters included)
  2. CFX =
    Uri uri = new Uri($"amqp://{Username}:{Password}@localhost:5672");
    string exchangeAddress = $"/exchange/exhangeA/routingKeyA";
    string queueAddress = $"/queue/queueA/";
    endpoint.AddPublishChannel(uri,exchangeAddress);
    endpoint.AddSubscribeChannel(uri,queueAddress);

Result:

  1. I am able to publish and receive message using CFX successfully

However if I delete the queue and recreate it using the rabbitMQ management, and make it into a lazy queue by putting arguments with "x-queue-mode" = true, or enable auto-delete to true for the queue, my CFX is able to publish messages , but it is unable to consume messages from the queue.
An error message will keep showing that as follows:

"ERROR extablishing connection to queue = PRECONDITION_FAILED - inequivalent arg 'auto_delete' for queue 'queueA' in vhost '/': received 'false' but current is 'true'"

I had already set up the bindings for the queue and exchanges.

I would appreciate it if someone will kindly please guide me / let me know if there is a way to consume message from the queue , if the queue created in the RabbitMQ broker consist of arguments? Or currently CFX is unable to consume message from the queue if the queue was created with arguments, and it is only able to consume message from the queue which is durable without any arguments set?

Kindly please correct me if I am wrong.

Any feedback would be appreciated.

Thanking you in anticipation.
Regards,
Snow Bunny.

Hi, @xXSnowBunny
Thank you for your contribution!
I am also new in CFX and RabbitMQ, so I want to know how do you created my exchange, queue, and bindings in RabbitMQ manually?
Best Regards!
Stevenazy

from cfx.

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.