[
https://issues.apache.org/jira/browse/CAMEL-19133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
geyipeng updated CAMEL-19133:
-----------------------------
Description:
{{{*}my code{*}:}}
{{@Component}}
{{public class MyRouter extends RouteBuilder {}}
{{@Value("${server.port}")}}
{{String port;}}
{{@Override}}
{{public void configure() throws Exception {}}
{{getCamelContext().addRoutePolicyFactory(new
ServiceRegistrationRoutePolicyFactory());}}
{{from("direct:1")}}
{{.routeProperty(ServiceDefinition.SERVICE_META_NAME, "addHello")}}
{{.routeProperty(ServiceDefinition.SERVICE_META_ID, "my-id" + port)}}
{{.routeProperty(ServiceDefinition.SERVICE_META_PORT, port)}}
{{.process(new Processor() {}}
{{@Override}}
{{public void process(Exchange exchange) throws Exception {}}
{{exchange.getMessage().setBody(exchange.getMessage().getBody() + "hello");}}
{{}}}
{{})}}
{{.log("${body}");}}
{{from("timer://foo?fixedRate=true&period=1000")}}
{{.serviceCall()}}
{{.name("addHello")}}
{{.zookeeperServiceDiscovery()}}
{{.nodes("127.0.0.1")}}
{{.basePath("/config")}}
{{.end()}}
{{.log("${body}");}}
{{}}}
{{}}}
{{issue:}}
{{The service registration function of zookeeper will carry type information
during serialization}}
{{!image-2023-03-11-09-09-06-741.png! }}
{{and an error will be reported due to different MetaData during
deserialization}}
{{!image-2023-03-11-09-11-24-022.png! }}
{{solution:}}
{{The internal class MetaData in the ZooKeeperServiceDiscovery and
ZooKeeperServiceRegistry needs to be extracted}}
{{This is my modified patch in the camel-3.20.2 revision of the camel-zookeeper
project}}
was:
issue:The service registration function of zookeeper will carry type
information during serialization
!image-2023-03-11-09-09-06-741.png!
and an error will be reported due to different MetaData during deserialization
!image-2023-03-11-09-11-24-022.png!
solution:
The internal class MetaData in the ZooKeeperServiceDiscovery and
ZooKeeperServiceRegistry needs to be extracted
This is my modified patch in the camel-3.20.2 revision of the camel-zookeeper
project
> Zookeeper's service registration and discovery is not working properly
> ----------------------------------------------------------------------
>
> Key: CAMEL-19133
> URL: https://issues.apache.org/jira/browse/CAMEL-19133
> Project: Camel
> Issue Type: Bug
> Components: camel-zookeeper
> Affects Versions: 3.20.2
> Environment: jdk17+springboot2.7.9+camel3.20.2
> Reporter: geyipeng
> Priority: Major
> Attachments: changeMetaData.patch, image-2023-03-11-09-09-06-741.png,
> image-2023-03-11-09-11-24-022.png
>
>
> {{{*}my code{*}:}}
> {{@Component}}
> {{public class MyRouter extends RouteBuilder {}}
> {{@Value("${server.port}")}}
> {{String port;}}
> {{@Override}}
> {{public void configure() throws Exception {}}
> {{getCamelContext().addRoutePolicyFactory(new
> ServiceRegistrationRoutePolicyFactory());}}
> {{from("direct:1")}}
> {{.routeProperty(ServiceDefinition.SERVICE_META_NAME, "addHello")}}
> {{.routeProperty(ServiceDefinition.SERVICE_META_ID, "my-id" + port)}}
> {{.routeProperty(ServiceDefinition.SERVICE_META_PORT, port)}}
> {{.process(new Processor() {}}
> {{@Override}}
> {{public void process(Exchange exchange) throws Exception {}}
> {{exchange.getMessage().setBody(exchange.getMessage().getBody() + "hello");}}
> {{}}}
> {{})}}
> {{.log("${body}");}}
> {{from("timer://foo?fixedRate=true&period=1000")}}
> {{.serviceCall()}}
> {{.name("addHello")}}
> {{.zookeeperServiceDiscovery()}}
> {{.nodes("127.0.0.1")}}
> {{.basePath("/config")}}
> {{.end()}}
> {{.log("${body}");}}
> {{}}}
> {{}}}
> {{issue:}}
> {{The service registration function of zookeeper will carry type information
> during serialization}}
> {{!image-2023-03-11-09-09-06-741.png! }}
> {{and an error will be reported due to different MetaData during
> deserialization}}
> {{!image-2023-03-11-09-11-24-022.png! }}
> {{solution:}}
> {{The internal class MetaData in the ZooKeeperServiceDiscovery and
> ZooKeeperServiceRegistry needs to be extracted}}
> {{This is my modified patch in the camel-3.20.2 revision of the
> camel-zookeeper project}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)