We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package test; import io.vertx.core.Handler; import io.vertx.core.Vertx; import io.vertx.core.json.JsonObject; import io.vertx.ext.bridge.BridgeOptions; import io.vertx.ext.bridge.PermittedOptions; import io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge; public class BridgeTest { public static void main(String[] args) { Vertx vertx = Vertx.vertx(); TcpEventBusBridge bridge = TcpEventBusBridge.create( vertx, new BridgeOptions() .addOutboundPermitted(new PermittedOptions().setAddress("out"))); bridge.listen(7000, res -> vertx.setPeriodic(2*1000, new Handler<Long>() { @Override public void handle(Long timer) { vertx.eventBus().send("out", new JsonObject().put("now", System.currentTimeMillis())); } })); } }
var EventBus = require('../lib/tcp-vertx-eventbus'); var eb = new EventBus('localhost', 7000); eb.onerror = function (err) { console.error(err); }; eb.onopen = function () { // send a echo message eb.registerHandler("out", function (err, msg) { console.log("message:" + JSON.stringify(msg)); }); };
bash-3.2$ node test/app.js message:{"type":"message","address":"out","headers":{},"body":{"now":1453190899736}} message:{"type":"message","address":"out","headers":{},"body":{"now":1453190899736}} message:{"type":"message","address":"out","headers":{},"body":{"now":1453190899736}} message:{"type":"message","address":"out","headers":{},"body":{"now":1453190899736}} message:{"type":"message","address":"out","headers":{},"body":{"now":1453190899736}}
Notice the value of 'now' in the message received by the client.
The text was updated successfully, but these errors were encountered:
dce0b28
Merge pull request #3 from vert-x3/issue/2
ba1d85a
Fixes #2: the node library was not cleaning the buffer after reading …
Verified. Works now, thanks for fixing this.
Sorry, something went wrong.
pmlopes
No branches or pull requests
Server
Client
Result
Notice the value of 'now' in the message received by the client.
The text was updated successfully, but these errors were encountered: