List of usage examples for org.springframework.messaging.simp.stomp StompHeaderAccessor toMap
public Map<String, Object> toMap()
From source file:org.tmarciniak.mtp.web.websocket.support.client.WebSocketStompSession.java
@SuppressWarnings("unchecked") public void send(String destination, Object payload) { StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.SEND); headers.setDestination(destination); Message<?> message = this.messageConverter.toMessage(payload, new MessageHeaders(headers.toMap())); sendInternal((Message<byte[]>) message); }
From source file:com.codeveo.lago.bot.stomp.client.WebSocketStompSession.java
public void send(String destination, Object payload) { StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.SEND); headers.setDestination(destination); sendInternal(/*from w w w . j av a 2 s. c om*/ (Message<byte[]>) this.messageConverter.toMessage(payload, new MessageHeaders(headers.toMap()))); }
From source file:smpp.networking.SimpleStompClient.java
public void send(String destination, Object payload) { StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.SEND); headers.setDestination(destination); Message<byte[]> message = (Message<byte[]>) this.messageConverter.toMessage(payload, new MessageHeaders(headers.toMap())); byte[] bytes = this.encoder.encode(message); try {/* ww w . j av a 2 s . com*/ this.session.getRemote().sendString(new String(bytes, DEFAULT_CHARSET)); } catch (IOException e) { throw new IllegalStateException(e); } }
From source file:org.springframework.samples.portfolio.web.tomcat.TestStompClient.java
public void send(String destination, Object payload) { StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.SEND); headers.setDestination(destination); Message<byte[]> message = (Message<byte[]>) this.messageConverter.toMessage(payload, new MessageHeaders(headers.toMap())); byte[] bytes = this.encoder.encode(message); try {/* w w w . ja v a 2s. co m*/ this.session.sendMessage(new TextMessage(new String(bytes, DEFAULT_CHARSET))); } catch (IOException e) { throw new IllegalStateException(e); } }