当前位置: 首页>>代码示例>>Java>>正文


Java ActiveMQMessage.onSend方法代码示例

本文整理汇总了Java中org.apache.activemq.command.ActiveMQMessage.onSend方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQMessage.onSend方法的具体用法?Java ActiveMQMessage.onSend怎么用?Java ActiveMQMessage.onSend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.command.ActiveMQMessage的用法示例。


在下文中一共展示了ActiveMQMessage.onSend方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onTransportError

import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
public void onTransportError() {
    if (connect != null) {
        if (connected.get() && connect.willTopic() != null && connect.willMessage() != null) {
            try {
                PUBLISH publish = new PUBLISH();
                publish.topicName(connect.willTopic());
                publish.qos(connect.willQos());
                publish.payload(connect.willMessage());
                ActiveMQMessage message = convertMessage(publish);
                message.setProducerId(producerId);
                message.onSend();
                sendToActiveMQ(message, null);
            } catch (Exception e) {
                LOG.warn("Failed to publish Will Message " + connect.willMessage());
            }
        }
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:MQTTProtocolConverter.java

示例2: onMQTTPublish

import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
void onMQTTPublish(PUBLISH command) throws IOException, JMSException {
    checkConnected();
    ActiveMQMessage message = convertMessage(command);
    message.setProducerId(producerId);
    message.onSend();
    sendToActiveMQ(message, createResponseHandler(command));
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:8,代码来源:MQTTProtocolConverter.java

示例3: send

import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
/**
 * Internal send method optimized: - It does not copy the message - It can
 * only handle ActiveMQ messages. - You can specify if the send is async or
 * sync - Does not allow you to send /w a transaction.
 */
void send(ActiveMQDestination destination, ActiveMQMessage msg, MessageId messageId, int deliveryMode, int priority, long timeToLive, boolean async) throws JMSException {
    checkClosedOrFailed();

    if (destination.isTemporary() && isDeleted(destination)) {
        throw new JMSException("Cannot publish to a deleted Destination: " + destination);
    }

    msg.setJMSDestination(destination);
    msg.setJMSDeliveryMode(deliveryMode);
    long expiration = 0L;

    if (!isDisableTimeStampsByDefault()) {
        long timeStamp = System.currentTimeMillis();
        msg.setJMSTimestamp(timeStamp);
        if (timeToLive > 0) {
            expiration = timeToLive + timeStamp;
        }
    }

    msg.setJMSExpiration(expiration);
    msg.setJMSPriority(priority);
    msg.setJMSRedelivered(false);
    msg.setMessageId(messageId);
    msg.onSend();
    msg.setProducerId(msg.getMessageId().getProducerId());

    if (LOG.isDebugEnabled()) {
        LOG.debug("Sending message: " + msg);
    }

    if (async) {
        asyncSendPacket(msg);
    } else {
        syncSendPacket(msg);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:42,代码来源:ActiveMQConnection.java

示例4: configure

import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
protected void configure(ActiveMQMessage msg) throws JMSException {
    long sequenceNumber = messageSequence.incrementAndGet();
    msg.setMessageId(new MessageId(producerId, sequenceNumber));
    msg.onSend();
    msg.setProducerId(producerId);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:7,代码来源:QueryBasedSubscriptionRecoveryPolicy.java


注:本文中的org.apache.activemq.command.ActiveMQMessage.onSend方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。