chamikaramj commented on code in PR #40482:
URL: https://github.com/apache/beam/pull/40482#discussion_r4262431732
##########
sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/SolaceIO.java:
##########
@@ -793,20 +824,32 @@ public PCollection<T> expand(PBegin input) {
Coder<T> coder = inferCoder(input.getPipeline(),
configuration.getTypeDescriptor());
- return input.apply(
- org.apache.beam.sdk.io.Read.from(
- new UnboundedSolaceSource<>(
- initializedQueue,
- sempClientFactory,
- sessionServiceFactory,
- configuration.getMaxNumConnections(),
- configuration.getDeduplicateRecords(),
- coder,
- configuration.getTimestampFn(),
- configuration.getWatermarkIdleDurationThreshold(),
- configuration.getParseFn(),
- configuration.getAckDeadline(),
- configuration.getNackOnTimeout())));
+ PCollection<T> output =
+ input.apply(
+ org.apache.beam.sdk.io.Read.from(
+ new UnboundedSolaceSource<>(
+ initializedQueue,
+ sempClientFactory,
+ sessionServiceFactory,
+ configuration.getMaxNumConnections(),
+ configuration.getDeduplicateRecords(),
+ coder,
+ configuration.getTimestampFn(),
+ configuration.getWatermarkIdleDurationThreshold(),
+ configuration.getParseFn(),
+ configuration.getAckDeadline(),
+ configuration.getNackOnTimeout())));
+
+ if (configuration.getEnableOpenTelemetryTracing()) {
+ output =
Review Comment:
We expect `T` to be of type `Solace.Record.class` right ?
If so should we add a check here for that to prevent unintended issues in
the reader ?
Also add a test pls.
AI suggestion:
```
if (configuration.getEnableOpenTelemetryTracing()) {
checkArgument(
TypeDescriptor.of(Solace.Record.class).isSupertypeOf(configuration.getTypeDescriptor()),
"SolaceIO.Read: withEnableOpenTelemetryTracing() requires
Solace.Record output "
+ "(SolaceIO.read()); user properties are not available after a
custom parseFn.");
// ... apply OpenTelemetryHeaderConsumer as today
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]