nats-streaming-proxy

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2019 License: MIT

README

nats-streaming-proxy

Write to the NATS Streaming via Memcached protocol.

Why?

Because some script languages don't have a high performance NATS Streaming clients, but have a good Memcached client :)

Example PHP client with connection pool.
<?php
$mem = new Memcached('nats-streaming-connection-pool');
if (count($mem->getServerList()) == 0) {
    $mem->addServer("10.112.179.191", 11211);
    $mem->addServer("10.112.179.192", 11211);
    // http://php.net/manual/en/memcached.constants.php
    $mem->setOption(Memcached::OPT_TCP_NODELAY, true);  // On some installations the connection pool doesn't work without this option.
    $mem->setOption(Memcached::OPT_COMPRESSION, false); // if you don't want surprises with a transparent compression.
}
$mem->set('subject', json_encode([
    'event_time' => time(),
    'event_type' => 'type',
    'payload'    => 'XXXX'
]));

Grafana Dashboard

Grafana dashboard

Directories

Path Synopsis
cmd
src

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL