0

Looks like there's no factory for building messageDrivenChannelAdapter, listenerContainers... in Spring messaging abstraction (org.springframework.messaging.*) instead of JMS (org.springframework.jms.*).

I mean so you can configure messaging's MappingJackson2MessageConverter instead of JMS's, use JmsMessagingTemplate...

Whimusical
  • 6,401
  • 11
  • 62
  • 105

1 Answers1

1

The JmsMessagingTemplate isn't designed for use from the Spring Integration flow. Here we have adapters and channels between them. The JmsMessagingTemplate is a one stop shop to be used from the target service without any flow capabilities.

You can use it though from the .handle(jmsMessagingTemplate::send) as Service Activator and from the IntegrationFlow.from(jmsMessagingTemplate::receive) as Inbound Channel Adapter.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • Hi Artem! It was just an example, I am more concerned on the whole design, if only I could create the channel adapter, container, mapper everything as messaging instead of particular JMS, I give an extra step of abstraction, but it sems like Integration DSL is not ready for it – Whimusical Jul 20 '17 at 16:12
  • Sorry, I don't understand you thoughts. Would you mind sharing more info? E.g. some PoC how that should look? I'm not sure why Spring Integration DSL should worry about those not related to the EIP abstractions. Thanks – Artem Bilan Jul 20 '17 at 16:19
  • As you'll probably know, from Spring 4.1 theres a whole messaging abstraction, allowing both JMS/Rabbit/AMQP... https://spring.io/blog/2014/04/30/spring-4-1-s-upcoming-jms-improvements#Messaging Abstraction. This is almost a clone of org.springframework.jms.* into org.springframework.messaging.*, rewriting a bit the logic of classes like MappingJackson2MessageConverter, JmsTemplate, Message, etc.. I am wondering if we can make use of factories and functions for messaging abstraction. Startign with Messaging.messageDrivenChannelAdapter... – Whimusical Jul 20 '17 at 16:31
  • OK. Thanks. And it should do, that `Messaging.messageDrivenChannelAdapter`? The `MessageReceivingOperations.receive()` is not message-driven, it is *pollable* and I've already shown you the pattern how it can be used from SI. Again: that is not what has been designed for SI. It is some alternative when you can't or don't want to use SI. – Artem Bilan Jul 20 '17 at 16:43
  • Of course, thanks for the info! As you wondered I just explained the rational of my doubt, but I totally understand the situation! – Whimusical Jul 20 '17 at 20:18