Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladdedita/42f251d207f8ad02a96e3478ac4dabdb to your computer and use it in GitHub Desktop.
Save vladdedita/42f251d207f8ad02a96e3478ac4dabdb to your computer and use it in GitHub Desktop.
@Service
public class MessageProcessingService {
private final MessageProcessor<TextMessage> textMessageProcessor;
private final MessageProcessor<ImageMessage> imageMessageProcessor;
@Autowired
public MessageProcessingService(MessageProcessor<TextMessage> textMessageProcessor,
MessageProcessor<ImageMessage> imageMessageProcessor) {
this.textMessageProcessor = textMessageProcessor;
this.imageMessageProcessor = imageMessageProcessor;
}
public void processMessage(Object message) {
//Custom processing logic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment