question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Define ExchangeType enum

See original GitHub issue

It would be useful to have a dedicated enum which spells out all the fixed values available for python consumption much like you find in the .net RabbitMQ client

https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/master/projects/client/RabbitMQ.Client/src/client/api/ExchangeType.cs

This source will likely be something like…

from enum import Enum

class ExchangeType(Enum) :
    direct = "Exchange type used for AMQP direct exchanges."
    fanout = "Exchange type used for AMQP fanout exchanges."
    headers = "Exchange type used for AMQP headers exchanges."
    topic = "Exchange type used for AMQP topic exchanges."

This will give folks the option to use enum references in their client code like

channel = self.connection.channel()
channel.exchange_declare(exchange='foo', exchange_type=ExchangeType.direct.name)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
lukebakkencommented, Dec 2, 2020

#1260 will address this.

1reaction
lukebakkencommented, Sep 10, 2019

Hello and thanks for using Pika.

I would be happy to review a pull request implementing this. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enum Types - Java™ Tutorials
In the Java programming language, you define an enum type by using the enum keyword. For example, you would specify a days-of-the-week enum...
Read more >
Shared Enum between Metal and Swift - Stack Overflow
I try to share an Enum that I defined in an Header File between metal and my swift project: #ifndef SharedIndizes_h #define SharedIndizes_h...
Read more >
MergeExchangeType Enum (Microsoft.SqlServer.Replication ...
Enumerates options for how the Merge Agent synchronizes data. In this article. Definition; Fields; Applies to. public enum class MergeExchangeType. C#
Read more >
API Reference - Wrapper for the aiormq for asyncio and humans
Declare an exchange. Parameters. name – string with exchange name or aio_pika.exchange.Exchange instance. type – Exchange type. Enum ExchangeType value or ...
Read more >
RabbitMQ Tutorial - Direct Exchange - Code Destine
First, we create an ExchangeType enum class, which will define all the exchange types. ? 01. 02. 03. 04. 05. 06.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found