Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Especificación del orden de ServiceActivator en un canal de publicación-suscripción en Spring Integration (usando javaConfig)

Actualmente estoy especificando un activador de servicio y un canal de publicación y suscripción relacionado en un archivo de integración-contexto.xml. Algo como esto (versión abreviada):

 <int:publish-subscribe-channel id="notificationChannel" task-executor="executor" /> <int:gateway service-interface="com.integration.gateway.RestClientGateway" default-request-channel="notificationChannel" async-executor="executor"/> <int:service-activator ref="restClient" method="sendRequest" **order="1"** input-channel="notificationChannel"/> <int:service-activator ref="actionPersistor" method="persistNotification" **order="2"** input-channel="notificationChannel"/>

Ahora necesito especificar una clase de ejecutor personalizada (para el registro de MDC), así que comencé a jugar con mover esto a un enfoque basado en anotaciones. Algo parecido a esto:

 @Bean @Description("PubSub channel for notification") public MessageChannel notificationChannel() { return new PublishSubscribeChannel(mdcTaskExecutor()); } @Bean public TaskExecutor mdcTaskExecutor() { return MDCThreadPoolTaskExecutor.newWithInheritedMdc(10, 20, 25); } @MessagingGateway(name = "restClientGateway", defaultRequestChannel = "notificationChannel", asyncExecutor = "mdcExecutor") public interface RestClientGateway { Future<Message<String>> sendRequest(Message<BlEvent> message); } @ServiceActivator(inputChannel = "notificationChannel") public Message<String> sendRequest(Message<BlEvent> message) { @ServiceActivator(inputChannel="notificationChannel") public void persistNotification(Message<BlEvent> message) {

Mi pregunta es si hay alguna forma de especificar el orden en el que los @ServiceActivators reciben un mensaje del canal pub-sub, similar a la forma en que podría definirlo en el archivo Integration-context.xml.

Muchas gracias por tu ayuda. Y disculpas de antemano si esto fue demasiado simple como establecer una propiedad, porque parece que no pude ubicarla.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Sí, simplemente puede agregar @Order junto con las anotaciones de Messaging.

Supongo que tenemos una omisión en el Manual de referencia, no mencionar eso.

¡Siéntete libre de plantear un ticket de JIRA sobre el asunto!

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!