[ 
https://issues.apache.org/jira/browse/CAMEL-12065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Cosentino reassigned CAMEL-12065:
----------------------------------------

    Assignee: Andrea Cosentino

> [Camel-consul] firstIndex cannot be set if it is out of Long range
> ------------------------------------------------------------------
>
>                 Key: CAMEL-12065
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12065
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-consul
>    Affects Versions: 2.20.1
>            Reporter: Viachaslau Tsikhanovich
>            Assignee: Andrea Cosentino
>
> [Documentation|http://camel.apache.org/consul-component.html] claims that 
> _firstIndex_ option must be of Long Java type.
> However WaitIndex (that is generated by Consul and should be set for 
> _firstIndex_ to skip all events until one that has such WaitIndex) is 
> actually of BigInteger type and can be out of Long type range - 
> https://github.com/hashicorp/consul/blob/master/api/event.go#L90-L104
> _org.apache.camel.component.consul.enpoint.ConsulEventConsumer_ has _index_ 
> field of correct type AtomicReference<BigInteger> and is initialized as
> {code}
> this.index = new 
> AtomicReference(BigInteger.valueOf(configuration.getFirstIndex()));
> {code}
> However BigInteger value that is out of Long range cannot be passed for 
> _index_  from apiEnpoint option _firstIndex_ because 
> _org.apache.camel.component.consul.ConsulConfiguration_ has _firstIndex_ 
> field that is declared as _long_ type:
> {code}
>     @UriParam(
>         label = "consumer,watch",
>         defaultValue = "0"
>     )
>     private long firstIndex;
> {code}
> Seems that it should be changed to be of BigInteger type.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to