This is an automated email from the ASF dual-hosted git repository.
pandaapo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 01cec6e62 [ISSUE #4090]replace with lambda. (#4487)
01cec6e62 is described below
commit 01cec6e62afec7326cbae78cb05ebbc4c240a75d
Author: HeeHunLee <[email protected]>
AuthorDate: Sun Oct 15 18:06:30 2023 +0800
[ISSUE #4090]replace with lambda. (#4487)
* replace with lambda.
* replace with lambda.
remove useless import
---
.../apache/eventmesh/runtime/demo/CCSubClient.java | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git
a/eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/demo/CCSubClient.java
b/eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/demo/CCSubClient.java
index be0697473..e16108a7b 100644
---
a/eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/demo/CCSubClient.java
+++
b/eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/demo/CCSubClient.java
@@ -23,10 +23,8 @@ import org.apache.eventmesh.common.protocol.tcp.Command;
import org.apache.eventmesh.common.protocol.tcp.Package;
import org.apache.eventmesh.runtime.client.common.MessageUtils;
import org.apache.eventmesh.runtime.client.common.UserAgentUtils;
-import org.apache.eventmesh.runtime.client.hook.ReceiveMsgHook;
import org.apache.eventmesh.runtime.client.impl.SubClientImpl;
-import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
@@ -40,17 +38,13 @@ public class CCSubClient {
subClient.heartbeat();
subClient.listen();
subClient.justSubscribe("TEST-TOPIC-TCP-SYNC",
SubscriptionMode.CLUSTERING, SubscriptionType.SYNC);
- subClient.registerBusiHandler(new ReceiveMsgHook() {
-
- @Override
- public void handle(Package msg, ChannelHandlerContext ctx) {
- if (log.isInfoEnabled()) {
- log.info("Received message: {}", msg);
- }
- if (msg.getHeader().getCommand() ==
Command.REQUEST_TO_CLIENT) {
- Package rrResponse = MessageUtils.rrResponse(msg);
- ctx.writeAndFlush(rrResponse);
- }
+ subClient.registerBusiHandler((msg, ctx) -> {
+ if (log.isInfoEnabled()) {
+ log.info("Received message: {}", msg);
+ }
+ if (msg.getHeader().getCommand() == Command.REQUEST_TO_CLIENT)
{
+ Package rrResponse = MessageUtils.rrResponse(msg);
+ ctx.writeAndFlush(rrResponse);
}
});
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]