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 8840607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:30:06+00:00 2026-06-14T10:30:06+00:00

In case of non-generated names it’s enough to call #’queue.declare’ to get newly created

  • 0

In case of non-generated names it’s enough to call #'queue.declare' to get newly created queue or existing one with given name. However, when using auto-generated names (beginning with amq.gen- prefix) it’s not as trivial. First of all, amq. is restricted prefix, so there is no way to call #'queue.declare'{queue=<<"amq.gen-xxx">>}.

I also tried to play with passive=true option and although I may pass restricted name, I get an exit error when queue does not exists. Following is error report:

** Handler sse_handler terminating in init/3
   for the reason exit:{{shutdown,
                        {server_initiated_close,404,
                            <<"NOT_FOUND - no queue 'amq.gen-wzPK0nIBPzr-dwtZ5Jy58V' in vhost '/'">>}},
                    {gen_server,call,
                        [<0.62.0>,
                         {call,
                             {'queue.declare',0,
                                 <<"amq.gen-wzPK0nIBPzr-dwtZ5Jy58V">>,
                                 true,false,false,false,false,[]},
                             none,<0.269.0>},
                         infinity]}}

Is there any way to solve this problem?

EDIT: Here is a short story behind this question. Disclaimer: I’m erlang newbie, so maybe there is better way to make it working 🙂

I have a gen_server based application holding SSE (server-side events) connections with web browsers. Each connection is bound to rabbitmq queue. SSE connection when broken, automatically tries to reconnect after given timeout – this is something that web browser supports out of the box. To reuse previously created queue I’m trying to check if queue of given name (taken from request cookie) already exists. It’s all done in init callback.

  • 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-06-14T10:30:07+00:00Added an answer on June 14, 2026 at 10:30 am

    You can declare a queue with the prefix amq. if the queue already exists. You would get Declare-Ok if the queue exists or access-refused if not. (My question is why would you, though? 😉

    Furthermore, you can use the passive option to check if it already exists. According to AMQP reference the server treats it as not-found error if the queue doesn’t exist. In order to catch this in your Erlang client you could try something around the lines of this:

    try 
        %% declare queue with passive=true
        queue_exists
    catch exit:{{shutdown, {server_initiated_close,404,_},_,_} -> 
        queue_does_not_exist 
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a use case where I need to call a (non-static) method in
could anyone tell me the difference between Terminal and non-terminal symbol in the case
Say,should keep the space between letters(a-z,case insensitive) and remove the space between non-letters?
Case One: new Date(Date.parse(Jul 8, 2005)); Output: Fri Jul 08 2005 00:00:00 GMT-0700 (PST)
Case One Say you have a little class: class Point3D { private: float x,y,z;
Given a MethodInfo instance that identifies an open generic method of a non-generic class,
I have a non-wcf server that I call from WCF client and I need
I`m working on a SAP project, where i have to call a non-sap service
If one writes two public Java classes with the same case-insensitive name in different
Case in point : I've got a handle to a window (for instance, using

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.