Search in sources :

Example 1 with StoreMessage

use of pers.cy.iris.commons.model.message.StoreMessage in project iris by chicc999.

the class PutMessageHandler method process.

@Override
public Command process(ChannelHandlerContext ctx, Command command) throws Exception {
    PutMessage putMessage = (PutMessage) command;
    System.out.println("收到putMessage请求," + new String(putMessage.getMessages()[0].getBody()));
    Message[] messages = putMessage.getMessages();
    for (Message message : messages) {
        store.putMessage((StoreMessage) message);
    }
    return new ErrorResponse(200, "", command.getRequestId());
}
Also used : Message(pers.cy.iris.commons.model.message.Message) PutMessage(pers.cy.iris.commons.network.protocol.request.PutMessage) StoreMessage(pers.cy.iris.commons.model.message.StoreMessage) PutMessage(pers.cy.iris.commons.network.protocol.request.PutMessage) ErrorResponse(pers.cy.iris.commons.network.protocol.response.ErrorResponse)

Aggregations

Message (pers.cy.iris.commons.model.message.Message)1 StoreMessage (pers.cy.iris.commons.model.message.StoreMessage)1 PutMessage (pers.cy.iris.commons.network.protocol.request.PutMessage)1 ErrorResponse (pers.cy.iris.commons.network.protocol.response.ErrorResponse)1