a-mazurok commented on code in PR #11838: URL: https://github.com/apache/camel/pull/11838#discussion_r1372031655
########## components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/ServiceBusProducer.java: ########## @@ -147,12 +147,12 @@ private BiConsumer<Exchange, AsyncCallback> sendMessages() { Mono<Void> sendMessageAsync; - if (exchange.getMessage().getBody() instanceof Iterable) { + if (exchange.getMessage().getBody() instanceof Iterable<?>) { sendMessageAsync - = serviceBusSenderOperations.sendMessages(convertBodyToList((Iterable<Object>) inputBody), + = serviceBusSenderOperations.sendMessages(convertBodyToList((Iterable<?>) inputBody), configurationOptionsProxy.getServiceBusTransactionContext(exchange), applicationProperties); } else { - sendMessageAsync = serviceBusSenderOperations.sendMessages(exchange.getMessage().getBody(String.class), + sendMessageAsync = serviceBusSenderOperations.sendMessages(inputBody, Review Comment: As I can see both consumers and producers will support only String, byte[] and BinaryData and only those types(besides special AmqpMessageBody and ServiceBusReceivedMessage types) are supported by underlying Azure library. I think that client developer can always convert any other Java type to String if necessary in proper way(including Camel type converters) than doing it internally and implicitly with toString() method or implicit Camel type converters. Binary data like Protobuf messages(our case) can't be properly converted to String type and I believe that many other organizations may have met the same limitation already. I understand that potentially that change can break some potentially existing clients who were relying on such implicit conversion of different Java types to String so such change shouldn't be released as minor version upgrade 4.1.X but I hope it can be included in 4.2.0 release together with documentation update. Maybe we can add the same change in new Camel 3.X.0 release as well(if any planned). -- 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: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org