Skip to main content

amqstompclient

A stomp client in python3 for ActiveMQ using the stomp.py library. The client reconnects automatically when ActiveMQ misses heartbeats. As of version 2.0 it is linked against stomp.py 8

Example 1:

from amqstompclient import amqstompclient
import logging
import time

logging.basicConfig(level=logging.INFO, format='%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s', datefmt="%Y-%m-%d %H:%M:%S")
logger = logging.getLogger()

server={"ip":"127.0.0.1","port":"61613","login":"admin","password":"*****","heartbeats":(30000,30000)}

conn=amqstompclient.AMQClient(server
      , {"name":"TEST","version":"1.0.0","lifesign":"/topic/COUCOU"}
      ,["/queue/QTEST1","/queue/QTEST2","/topic/TTEST1","/topic/TTEST2"])        

while True:
    time.sleep(5)
    conn.send_life_sign()

Example 2:

Using a message received callback.

from amqstompclient import amqstompclient
import logging
import time

def callback(destination, message,headers):
    logger.info("Received:"+message)
    conn.send_message("/topic/TTEST2","FROMCALLBACK")


logging.basicConfig(level=logging.INFO, format='%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s', datefmt="%Y-%m-%d %H:%M:%S")
logger = logging.getLogger()

server={"ip":"127.0.0.1","port":"61613","login":"admin","password":"*****","heartbeats":(30000,30000)}

conn=amqstompclient.AMQClient(server
        , {"name":"TEST","version":"1.0.0","lifesign":"/topic/HELLO"}
        ,["/queue/QTEST1","/queue/QTEST2","/topic/HELLO"]
        ,callback=callback)        

while True:
    time.sleep(5)
    conn.send_life_sign()

AMQC

Early Ack

It is possible to set earlyack to True in order to ack the message before calling the callback. This way, the message will not be rolled back if the callback fails.

{"ip":activemq_address,"port":activemq_port,"login":activemq_user, "password":activemq_password,"heartbeats":(30000,30000),"earlyack":True}

Release files for amqstompclient 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amqstompclient 2.0.3
File Size Uploaded
amqstompclient-2.0.3.tar.gz 8.2 kB Details

Release files / amqstompclient-2.0.3.tar.gz

Download URL amqstompclient-2.0.3.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2940594016084764192ef49d6ce75c18d81dc69ef307e7082817e5dd7e81e419
BLAKE2b-256 checksum
How to use checksums
5f2a99cf12522b5162d78e23b7862dbce433cfa34523bef3b6c2ff3a49f84a54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

2.0.3 This release

1 release file

1.2.0

1 release file

1.1.14

1 release file

1.1.13

1 release file

1.1.12

1 release file

1.1.11

1 release file

1.1.10

1 release file

1.1.9

1 release file

1.1.8

1 release file

1.1.7

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.9

1 release file

1.0.7

1 release file

1.0.5

1 release file

1.0.3

1 release file

1.0.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page