Claus Ibsen created CAMEL-27961:
-----------------------------------

             Summary: camel-pubnub: CamelMessageTimestamp is 10,000 times too 
large, deprecated SDK builders log a WARN per message
                 Key: CAMEL-27961
                 URL: https://issues.apache.org/jira/browse/CAMEL-27961
             Project: Camel
          Issue Type: Bug
          Components: camel-pubnub
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-pubnub for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31198).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. CamelMessageTimestamp is 10,000 times too large
{{PubNubConsumer.PubNubCallback}} message() and presence() set 
Exchange.MESSAGE_TIMESTAMP (epoch milliseconds) to the PubNub timetoken, which 
is in units of 100 nanoseconds (17 digits).
Proposed change: set it to timetoken / 10_000 and keep CamelPubNubTimeToken as 
the raw timetoken.

h4. 2. Every PUBLISH, FIRE and GETHISTORY logs a deprecation WARN
{{PubNubProducer}} doPublish, doFire and doGetHistory use the deprecated 
builders publish(), fire() and history(); in PubNub Java SDK 14.2.0 each call 
logs WARN "DEPRECATED: ... builder pattern is deprecated" (PubNubForJavaImpl).
Proposed change: use publish(message, channel), fire(message, channel) and 
fetchMessages() for GETHISTORY (the result type changes, so an upgrade-guide 
note is needed).

h4. 3. Smaller issues
uuid is required and has no default: a null uuid fails with a 
NullPointerException from new UserId(null) in PubNubEndpoint.getInstance(); it 
stays required when a pubnub client is set, where only GETSTATE and SETSTATE 
use it. subscribeKey is not marked required, but 
PNConfiguration.builder(userId, subscribeKey) rejects null, so every endpoint 
without a pubnub client (producers too) fails to start without it. Doc page: 
the "Fire events" example misses a closing quote, the examples leave out the 
required uuid, and the link to the BLOCKS catalog is outdated (now PubNub 
Functions).


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to