Skip to content

Commit

Permalink
modify example
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielePalaia committed Jan 7, 2025
1 parent 32ded40 commit 9043c94
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions examples/getting_started/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,35 @@ def main() -> None:

management.declare_exchange(ExchangeSpecification(name=exchange_name, arguments={}))

management.declare_queue(
binding_exchange_queue_path = management.declare_queue(
QueueSpecification(name=queue_name, queue_type=QueueType.quorum, arguments={})
)

management.bind(
BindingSpecification(
source_exchange=exchange_name,
destination_queue=queue_name,
binding_key=routing_key,
)
)

addr = exchange_address(exchange_name, routing_key)
#management.bind(
# BindingSpecification(
# source_exchange=exchange_name,
# destination_queue=queue_name,
# binding_key=routing_key,
# )
#)

#addr = exchange_address(exchange_name, routing_key)

publisher = connection.publisher(addr)
#publisher = connection.publisher(addr)

publisher.publish(Message(body="test"))
#publisher.publish(Message(body="test"))

publisher.close()
#publisher.close()

# management.unbind(binding_exchange_queue_path)
#management.unbind(binding_exchange_queue_path)

# management.purge_queue(queue_info.name)

# management.delete_queue(queue_name)
management.delete_queue(queue_name)

management.delete_exchange(exchange_name)

# management.delete_exchange(exchange_name)

management.close()

Expand Down

0 comments on commit 9043c94

Please sign in to comment.