jkarneges on develop
ensure keep-alives are sent in … (compare)
jkarneges on master
handler: make http publish maxi… Merge pull request #47691 from … Merge remote-tracking branch 'o… and 7 more (compare)
jkarneges on v1.31.0
jkarneges on develop
update version (compare)
jkarneges on develop
use condure by default (compare)
jkarneges on develop
runner: support for ssl ports w… (compare)
jkarneges on develop
ensure queueable events are onl… (compare)
jkarneges on develop
avoid adding extra minutes to r… (compare)
jkarneges on develop
handler: split out wssession make it possible to refresh web… (compare)
jkarneges on develop
readme nits, remove mailing list Merge remote-tracking branch 'o… (compare)
jkarneges on master
readme nits, remove mailing list (compare)
jkarneges on develop
handler: make http publish maxi… Merge pull request #47691 from … (compare)
jkarneges on v1.30.0
jkarneges on master
limit body bytes to internal bu… runner: support condure service use client_maxconn and condure_… and 1 more (compare)
jkarneges on develop
update version (compare)
jkarneges on develop
use client_maxconn and condure_… (compare)
jkarneges on develop
runner: support condure service (compare)
jkarneges on develop
limit body bytes to internal bu… (compare)
jkarneges on v1.29.0
jkarneges on master
fix crash when parsing accept h… provide credits on websocket ac… fix crash when response hold ti… and 10 more (compare)
ws.sendControl({"type": "keep-alive", "message-type": "ping", "content": "", "timeout": 30})
ws.recv()
returns null, call ws.close()
) and ignore disconnects
ws.sendControl({"type": "keep-alive", "content": "still alive", "timeout": 30})
Hi @jkarneges
I am trying to send messages to pushping using 0mq but I am unable to do it, I am using the following code:
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket publisher = context.socket(ZMQ.PUB);
publisher.connect("tcp://" + ip + ":5562");
publisher.send("J{\"id\": \"an-item-id\", \"channel\": \"test\", \"formats\": {\"http-stream\": {\"content\": \"a chunk of data\n\"}}}",0);
publisher.close();
context.term();
I am also using the following versions of 0MQ,
zeromq-4.1.4
zeromq/jzmq
The code does not display an error but messages are not appearing in pushpin logs.
Any suggestion related to this? might I be missing something?
Hi @jkarneges ,
We are trying to publish messages through ZeroMQ to pushpin and something that we noticed was, if the message has new line characters (\n) the message breaks
For eg if we are trying to publish a json to pushpin it will not be a json as new line characters are parsed.
Can you suggest how can we make ZMQ escape the new line characters in the original message?
Thanks
ZMQ.Context context = ZMQ.context(1);
publisher = context.socket(ZMQ.PUB);
publisher.connect("tcp://localhost:5562");
Thread.sleep(700);
String channelId = "test-channelId";
String messageId = data.getId();
String serializedWebSocketEvent = gson.toJson(data);
ZMsg zMsg = new ZMsg();
zMsg.addString(channelId);
zMsg.addString(getBodyMessage(channelId,serializedWebSocketEvent));
zMsg.send(publisherSubSocket);
private String getBodyMessage(String messageId,String channel,String content){
StringBuilder bodyMessage = new StringBuilder();
messageId = Strings.isNullOrEmpty(messageId) ? UUID.randomUUID().toString().replace("-","") : messageId;
bodyMessage.append("J{\"id\": \"")
.append(messageId)
.append("\",")
.append("\"channel\": \"")
.append(channel)
.append("\",")
.append("\"formats\": {\"")
.append("ws-message")
.append("\":{\"content\":\"")
// Note: Having new line characters messes the message in zeromq
.append(content.replace("\\n","").replace("\"","\\\"") )
.append("\"}}}");
return bodyMessage.toString();
}
content
field would get escaped as part of that process), or json-encode just the content value and use that in your string concatenations
GripControl.createGripChannelHeader
creates a single header value. if your http server library supports setting multiple values for the same header name, then you can just call that method multiple times and set the result. if not, you'll need to join the values with a semicolon ;
and set as a single value