view spring-jms-playground/src/main/java/de/comline/jms/receiver/QueueReceiver.java @ 16:4217059d40e8

Test zum Empfang einer ganzen JMS Message, nicht nur der Payload
author Dirk Olmes <dirk.olmes@codedo.de>
date Thu, 10 Sep 2020 09:32:21 +0200
parents ad77abd85976
children a9675808f1dd
line wrap: on
line source

package de.comline.jms.receiver;

import javax.jms.TextMessage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import de.comline.jms.application.Application;

@Component
public class QueueReceiver {
	private static final Logger LOG = LoggerFactory.getLogger(QueueReceiver.class);

	@JmsListener(destination = "input-queue", containerFactory = Application.AMQ_FACTORY_BEAN)
	public void receive(String message) {
		LOG.info("received {}", message);
	}

	@JmsListener(destination = "validated", containerFactory = Application.AMQ_FACTORY_BEAN)
	public void receive(TextMessage message) {
		LOG.info("received message {}", message);
	}
}