The community forums are in BETA and closed to the public.

How to Rapidly Publish Messages on PubNub

Rapid Publishing of Messages on PubNub. You can publish message efficiently using this mechanism. How efficient you ask? This method allows you to publish upwards of 30 messages Per TCP Packet. Wow!

PubNub HTTP Pipelining

Sending messages in parallel and in a Single TCP Packet (one Ethernet Frame) is really easy with PubNub HTTP Pipelining! We provide an example below of the Socket level data you send per message. Note that we support the full Pipelining mechanism for HTTP Pipelining. You may send serially on a single socket without waiting for the response and the responses return in order.

Essentially -- To really make this happen with top tier performance you would follow this recipe:

  1. Open 100 TCP sockets to geo1.pubnub.com (closest data center) with fallbacks next closest data center of geo2.pubnub.com geo3.pubnub.com.
  2. Send HTTP/1.1 commands round robin -- without waiting for responses you may continue sending commands! -- Pipelining!
  3. Add socket fail detect or TIMEOUTs as needed for retries.
  4. Rejoice with awesome cool-guy dance moves.

PubNub Publish Format

GET /publish/<PUB_KEY>/<SUB_KEY>/0/<CHANNEL>/0/<PAYLOAD> HTTP/1.1\r\n 
Host: pubsub.pubnub.com\r\n\r\n

Pipeline Publish 3 Messages in 1 TCP Packet

GET /publish/demo/demo/0/chan/0/"ONE" HTTP/1.1\r\n 
Host: pubnub\r\n\r\n
GET /publish/demo/demo/0/chan/0/"TWO" HTTP/1.1\r\n 
Host: pubnub\r\n\r\n
GET /publish/demo/demo/0/chan/0/"THREE" HTTP/1.1\r\n 
Host: pubnub\r\n\r\n

This following example will show you what publishing three messages in a single TCP Packet may look like. You should test this directly in your Terminal Window via TELNET app.

telnet pubsub.pubnub.com 80

GET /publish/demo/demo/0/my_channel/0/"ONE" HTTP/1.1
Host: pubnub

GET /publish/demo/demo/0/my_channel/0/"TWO" HTTP/1.1
Host: pubnub

GET /publish/demo/demo/0/my_channel/0/"THREE" HTTP/1.1
Host: pubnub

Comments to this discussion are now closed!