use of org.apache.eventmesh.runtime.client.impl.PubClientImpl in project incubator-eventmesh by apache.
the class BroadCastPubClient method main.
public static void main(String[] args) throws Exception {
PubClientImpl pubClient = new PubClientImpl("127.0.0.1", 10000, UserAgentUtils.createUserAgent());
pubClient.init();
pubClient.heartbeat();
for (int i = 0; i < 10000; i++) {
ThreadUtils.randomSleep(0, 500);
pubClient.broadcast(MessageUtils.broadcastMessage(ClientConstants.BROADCAST_TOPIC, i), 5000);
}
}
use of org.apache.eventmesh.runtime.client.impl.PubClientImpl in project incubator-eventmesh by apache.
the class AsyncPubClient method main.
public static void main(String[] args) throws Exception {
PubClientImpl pubClient = new PubClientImpl("127.0.0.1", 10000, UserAgentUtils.createUserAgent());
pubClient.init();
pubClient.heartbeat();
pubClient.registerBusiHandler(new ReceiveMsgHook() {
@Override
public void handle(Package msg, ChannelHandlerContext ctx) {
logger.error("receive msg-----------------------------" + msg.toString());
}
});
for (int i = 0; i < 1; i++) {
ThreadUtils.randomSleep(0, 500);
pubClient.broadcast(MessageUtils.asyncMessage(ClientConstants.ASYNC_TOPIC, i), 5000);
}
}
use of org.apache.eventmesh.runtime.client.impl.PubClientImpl in project incubator-eventmesh by apache.
the class CCPubClient method main.
public static void main(String[] args) throws Exception {
PubClientImpl pubClient = new PubClientImpl("127.0.0.1", 10000, UserAgentUtils.createUserAgent());
pubClient.init();
pubClient.heartbeat();
pubClient.broadcast(MessageUtils.rrMesssage(ClientConstants.ASYNC_TOPIC, 0), 5000);
}
use of org.apache.eventmesh.runtime.client.impl.PubClientImpl in project incubator-eventmesh by apache.
the class SyncPubClient method main.
public static void main(String[] args) throws Exception {
PubClientImpl pubClient = new PubClientImpl("127.0.0.1", 10000, UserAgentUtils.createUserAgent());
pubClient.init();
pubClient.heartbeat();
for (int i = 0; i < 100; i++) {
Package rr = pubClient.rr(MessageUtils.rrMesssage("TEST-TOPIC-TCP-SYNC", i), 3000);
if (rr.getBody() instanceof EventMeshMessage) {
String body = ((EventMeshMessage) rr.getBody()).getBody();
logger.error("rrMessage: " + body + " " + "rr-reply-------------------------------------------------" + rr);
}
}
}
Aggregations