stomp - Spring Integration for SimpMessagingTemplate -
i have mvc project below
@autowired simpmessagingtemplate messagingtemplate; private void sendalarmupdate(alarmnotify alarmnotify) { messagingtemplate.convertandsend("/topic/notify/alarm",alarmnotify); }
i trying convert spring integration using int-stomp:outbound-channel-adapter
getting exception message payload should array of bytes , tried converting object json still same , correct way send stomp json message spring-integration
@bean public reactor2tcpstompclient stompclient() { reactor2tcpstompclient stompclient = new reactor2tcpstompclient("192.168.70.xxx", 61613); //stompclient.setmessageconverter(new passthrumessageconverter()); threadpooltaskscheduler taskscheduler = new threadpooltaskscheduler(); taskscheduler.afterpropertiesset(); stompclient.settaskscheduler(taskscheduler); stompclient.setreceipttimelimit(5000); return stompclient; } @bean public stompsessionmanager stompsessionmanager() { reactor2tcpstompsessionmanager stompsessionmanager = new reactor2tcpstompsessionmanager(stompclient()); stompsessionmanager.setautoreceipt(true); return stompsessionmanager;
}
<int:chain input-channel="stompchannel"> <!--<int:object-to-json-transformer />--> <int-stomp:outbound-channel-adapter stomp-session-manager="stompsessionmanager" destination="/topic/notify/alarm1" id="stompadapter" /> </int:chain>
the problem stomp protocol on wire requires byte[]
message body.
so, don't have choice unless convert json byte[]
manually, or provide stringmessageconverter
stompclient
instead of commented passthrumessageconverter
.
Comments
Post a Comment