how to push data from BlazeDS without receive message from Flex client?

前端 未结 3 560
温柔的废话
温柔的废话 2020-12-10 08:34

I am using BlazeDS for data-push feature in my Flex application project. From the official tutorial, Getting started with BlazeDS, it shows messaging example with producer/c

3条回答
  •  攒了一身酷
    2020-12-10 09:33

    Do you need to push messages from the server to the client? In this case take a look in the BlazeDS samples. There is a sample in a folder called traderdesktop. The piece of code which is sending the messages is below:

    MessageBroker msgBroker = MessageBroker.getMessageBroker(null);
    
    AsyncMessage msg = new AsyncMessage();
    
    msg.setDestination(yourdestination);
    
    msg.setClientId(clientID);
    
    msg.setMessageId(UUIDUtils.createUUID());
    
    msg.setTimestamp(System.currentTimeMillis());
    
    msg.setBody("dummy");
    
    msgBroker.routeMessageToService(msg, null);
    

提交回复
热议问题