Comments (6)
http://pythonhosted.org//stompy/reference/stompy.stomp.html
from stomp.py.
Sorry, no idea what you mean by a "long connection".
In addition, you've got the wrong project. stompy (the page you reference above) is nothing to do with stomp.py.
Think you should probably be directing your question to the owner of that project: https://bitbucket.org/benjaminws/python-stomp/
from stomp.py.
Hi, stompy can use "clientid" to connect old connection, but I can not find the relevant parameter of stom.py. So I want to know how can I find that ?
from stomp.py.
I want to use the persistent connection to send message, I do not want the "start" "connect" "disconnect" appear frequently.
from stomp.py.
I believe clientid is something activemq specific. It's not a stomp header. So there is no relevant parameter. I you check the API documentation (http://jasonrbriggs.github.io/stomp.py/classstomp_1_1protocol_1_1_protocol12.html) you'll see that you can send arbitrary headers using the headers parameter.
As for persistent connections, the connection will stay open as long as the server allows.
from stomp.py.
class MyListener(object):
def __init__(self,conn):
self.conn = conn
def on_message(self, headers, message):
# some data processing for message
send_msg = json.dumps(send_msg)
# send to next queue
dest = '/queue/smtp'
ef.sendMessage(send_msg,dest,self.conn)
def branch(i,stomp_host):
if stomp_host != None:
#get message from JMS
conn = stomp.Connection([(stomp_host[0],stomp_host[1])],user=stomp_host[2],passcode=stomp_host[3])
conn.set_listener('', MyListener(conn))
conn.start()
conn.connect(wait=True)
conn.subscribe(headers={'destination':'/queue/edm','activemq.prefetchSize':1, 'ack':'auto'})
time.sleep(1)
#conn.disconnect()
while True:
try:
time.sleep(1)
except:
break
else:
ef.edmLogs('stomp_host error branch','sysLog.log')
def sendMessage(send_msg,dest,conn=False):
if conn:
conn.send(send_msg, destination=dest)
else:
stomp_host = MQSelect()
if stomp_host == None :
edmLogs('error about mq ','runlog.log',True,False)
else :
conn = stomp.Connection([(stomp_host[0], stomp_host[1])],user=stomp_host[2],passcode=stomp_host[3])
conn.start()
conn.connect(wait=True)
conn.send(send_msg, destination=dest)
conn.disconnect()
Use “conn” to send message,but sometimes it do not work. Can you give me some suggestions?
测试环境没问题,正式环境不行,还真是头疼!
from stomp.py.
Related Issues (20)
- Not streaming new messages
- heartbeat thread should not call transport.disconnect_socket()
- try_setsockopt() usage in transport.py broken on Mac HOT 2
- stomp batch data collection issue
- Race condition between ack/nack (mode client/client-individual) and disconnects (+ Fix provided)
- Issue with connecting with correct stomp HOT 7
- NameError: name 'dt' is not defined when SSL certificate expired HOT 1
- Disable hostname verification while providing the cacerts
- Listener/transport modules too verbose when using heartbeat
- in adapter.ws.py, logging module should be imported from stomp HOT 1
- Release cadence HOT 3
- Get response for send() in stomp.py to retry in case of failure
- SSL PROTOCOL_TLS Deprecated HOT 1
- [Help] How can I use stomp.py to subscribe and set a receiving listener to endpoint properly? HOT 2
- Possible to only process a message received for a certain correlation id (or other property) HOT 1
- An error occurred when running the stompy example HOT 1
- Configure the redelivery for a message
- 8.1.0 tag missing on GitHub HOT 2
- Subscription Wildcards Support? HOT 2
- WSConnection does not handle binary messages HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stomp.py.