send.py and test.py work

This commit is contained in:
Peter Kotyczka 2024-02-09 00:46:10 +01:00
parent 1238286602
commit 6fb82d6538
6 changed files with 2 additions and 27 deletions

View File

@ -1,26 +0,0 @@
from proton import Message
from proton.handlers import MessagingHandler
from proton.reactor import Container
class HelloWorld(MessagingHandler):
def __init__(self, server, address):
super(HelloWorld, self).__init__()
self.server = server
self.address = address
def on_start(self, event):
conn = event.container.connect(self.server)
event.container.create_receiver(conn, self.address)
event.container.create_sender(conn, self.address)
def on_sendable(self, event):
event.sender.send(Message(body="Hello World!"))
event.sender.close()
def on_message(self, event):
print(event.message.body)
event.connection.close()
Container(HelloWorld("localhost:5672", "examples")).run()

View File

@ -15,7 +15,8 @@ services:
- "./artemis-data:/var/lib/artemis-instance/data:rw"
ports:
- 8161:8161
- 61616:61616
- 61613:61616
- 5672:5672
mem_limit: 512m
mem_reservation: 256m
networks: