Added Service Activator
(cherry picked from commit 94c6cac)
This commit is contained in:
parent
a44be73deb
commit
9b0cfbafbf
|
@ -0,0 +1,7 @@
|
|||
package com.baeldung.samples.endpoints;
|
||||
|
||||
public interface Activator<T> {
|
||||
|
||||
public void handleMessage(T input);
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.baeldung.samples.endpoints;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.springframework.integration.IntegrationMessageHeaderAccessor;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
public class ActivatorImpl implements Activator<Message<File>> {
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message<File> input) {
|
||||
File filePayload = input.getPayload();
|
||||
IntegrationMessageHeaderAccessor accessor = new IntegrationMessageHeaderAccessor(input);
|
||||
Logger.getAnonymousLogger().info("The file size "+filePayload.length());
|
||||
Logger.getAnonymousLogger().info("The time of the message "+accessor.getTimestamp());
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue