-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/26650 payload sampling #591
base: epic/tag-integration-backend-frontend
Are you sure you want to change the base?
Feature/26650 payload sampling #591
Conversation
ee882c6
to
30f175e
Compare
83488d1
to
feb5308
Compare
30f175e
to
bb016ea
Compare
public @NotNull Response getSchemaForTopic(@NotNull final String topicBase64) { | ||
final String topic = new String(Base64.getDecoder().decode(topicBase64), StandardCharsets.UTF_8); | ||
final List<byte[]> samples = samplingService.getSamples(topic); | ||
if (samples.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some logs here?
try { | ||
jsonSamples.add(objectMapper.readTree(sample)); | ||
} catch (final IOException e) { | ||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some logs here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question is whether we should log the broken payload here. Guess the Exception message must be enough.
if (customBridgeLimitations != null) { | ||
final Long queueLimitFromConfig = customBridgeLimitations.queueLimit; | ||
if (queueLimitFromConfig != null) { | ||
// bridges can overwrite the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would log something like this on info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no we shouldnt do this. This would scale the log messages linear with the amount of messages. Logging even competes for exclusive access => contention.
} | ||
|
||
public void startSampling(final @NotNull String topic) { | ||
final String clientId = SAMPLER_PREFIX + topic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some logs here?
clientId); | ||
} | ||
|
||
public void stopSampling(final @NotNull String topic) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some logs here?
localTopicTree.removeSubscriber(clientId, topic, null); | ||
} | ||
|
||
public @NotNull List<byte[]> getSamples(final @NotNull String topic) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs and a metric would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should the metric measure? Invocations? Number of returned samples? When would this metric help?
https://hivemq.kanbanize.com/ctrl_board/57/cards/26650/details/