Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4593822
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:44:22+00:00 2026-05-21T22:44:22+00:00

In the .NET version (2.4.1) of RabbitMQ the RabbitMQ.Client.MessagePatterns.SimpleRpcClient has a Call() method with

  • 0

In the .NET version (2.4.1) of RabbitMQ the RabbitMQ.Client.MessagePatterns.SimpleRpcClient has a Call() method with these signatures:

    public virtual object[] Call(params object[] args);
    public virtual byte[] Call(byte[] body);
    public virtual byte[] Call(IBasicProperties requestProperties, byte[] body, out IBasicProperties replyProperties);

The problem:

With various attempts, the method still continues to not block where I expect it to, so it’s unable ever handle the response.

The Question:

Am I missing something obvious in the setup of the SimpleRpcClient, or earlier with the IModel, IConnection, or even PublicationAddress?

More Info:

I’ve also tried various paramater configurations of the QueueDeclare() method too with no luck.

string QueueDeclare(string queue, bool durable, bool exclusive, bool autoDelete, IDictionary arguments);

Some more reference code of my setup of these:

IConnection conn = new ConnectionFactory{Address = "127.0.0.1"}.CreateConnection());
using (IModel ch = conn.CreateModel())
{
     var client = new SimpleRpcClient(ch, queueName);
     var queueName = ch.QueueDeclare("t.qid", true, true, true, null);

     ch.QueueBind(queueName, "exch", "", null);

     //HERE: does not block?
     var replyMessageBytes = client.Call(prop, msgToSend, out replyProp);
}

Looking elsewhere:

Or is it likely there’s an issue in my “server side” code? With and without the use of BasicAck() it appears the client has already continued execution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:44:22+00:00Added an answer on May 21, 2026 at 10:44 pm

    –SHORT ANSWER–

    Bit of the “You’re doing it wrong“…

    Check on IBasicProperties, and you should be using SimpleRpcServer with HandleSimpleCall()

    If you stumble upon this question, you’ve either taken the wrong approach as I have, and possibly if made a similar mistake of manipulating IBasicProperties incorectly thereby hurting the ability of SimpleRpcServer to function correctly.

    –LONG ANSWER–

    Working Sample for .NET:
    Find my working example up on BitBucket here:

    https://bitbucket.org/NickJosevski/synchronous-rabbitmq-sample-.net

    Or here’s a quick sample…

    Client side:

    IConnection conn = new ConnectionFactory{Address = "127.0.0.1"}.CreateConnection();
    using (IModel ch = conn.CreateModel())
    {
        ch.ExchangeDeclare(Helper.ExchangeName, "direct");
    
        var queueName = ch.EnsureQueue();
    
        var client = new SimpleRpcClient(ch, queueName);
    
        var msgToSend = new Message(/*data*/).Serialize();
    
        IBasicProperties replyProp;
    
        var reply = client.Call(new BasicProperties(), msgToSend, out replyProp);
    }
    

    Server side:

    IConnection conn = new ConnectionFactory{Address = "127.0.0.1"}.CreateConnection();
    using (IModel ch = conn.CreateModel())
    {
        ch.ExchangeDeclare(Helper.ExchangeName, "direct");
        var queuename = ch.EnsureQueue();
    
        var subscription = new Subscription(ch, queuename);
    
        new MySimpleRpcServerSubclass(subscription).MainLoop();
    }
    
    internal class MySimpleRpcServerSubclass : SimpleRpcServer
    {
        public MySimpleRpcServerSubclass(Subscription subscription) 
            : base(subscription) { }
    
        public override byte[] HandleSimpleCall(
            bool isRedelivered, IBasicProperties requestProperties, 
            byte[] body, out IBasicProperties replyProperties)
        {
            replyProperties = requestProperties;
            replyProperties.MessageId = Guid.NewGuid().ToString();
    
            var m = Message.Deserialize(body);
            var r = 
                new Response
                {
                    Message = String.Format("Got {0} with {1}", m.Name, m.Body)
                };
    
            return r.Serialize();
        }
    }
    

    Shared:

    //helper:
    public static string EnsureQueue(this IModel ch)
    {
        var queueName = ch.QueueDeclare(QueueId, false, false, false, null);
    
        ch.QueueBind(queueName, ExchangeName, "", null);
    
        return queueName;
    }
    
    //NOTE: 
    not all extension methods are explained here, such as *.Serialize()* 
    as they're not relevant and just make for a cleaner example.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone written a version of .Net's generic Queue that implements INotifyCollectionChanged, or is
How does ADO.Net know which version of the SQL Native Client to use if
how to set ASP.NET version for virtual directory using c#.net FROM CODE for all
I see that version 2 of MVC.NET now has a RequireHttps attribute, which works
I have CruiseControl.NET Version 1.4 set up on my development server. Whenever a developer
My source code needs to support both .NET version 1.1 and 2.0 ... how
When I create a web site on IIS6 it defaults the ASP.NET version to
I've implemented full text search for a web site using Lucene.NET (Version 2.0). Indexing
Lucene is an excellent search engine, but the .NET version is behind the official
I need to determine the highest .NET framework version installed on a desktop machine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.