Last active
December 4, 2015 13:17
-
-
Save jonashackt/7ec053e82bb496d92568 to your computer and use it in GitHub Desktop.
Define Method as RabbitMQ-Queue-Listener via Annotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.amqp.rabbit.annotation.RabbitListener; | |
import org.springframework.messaging.handler.annotation.Payload; | |
import org.springframework.stereotype.Component; | |
import de.codecentric.microplode.configuration.MessagingConfiguration; | |
import de.codecentric.microplode.messaging.api.Event; | |
@Component | |
public class EventResultHandler { | |
@RabbitListener(queues=MessagingConfiguration.queueNameComputerPlayer) | |
public void handleMessage(@Payload Event event) { | |
System.out.println("Event received"); | |
System.out.println("EventType: " + event.getType().getText()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment