@Override public RoutingStatus send(final Message message, final boolean direct) throws Exception { return send(message, direct, false); }
@Override public RoutingStatus send(final Message message, final boolean direct, boolean noAutoCreateQueue) throws Exception { return send(getCurrentTransaction(), message, direct, noAutoCreateQueue); }
session.getServer().getPostOffice().route(serverMessage, tx, true); } else { session.getServerSession().send(tx, serverMessage, true, false);
session.getServer().getPostOffice().route(serverMessage, tx, true); } else { session.getServerSession().send(tx, serverMessage, true, false);
void handlePubRec(int messageId) throws Exception { try { Pair<Long, Long> ref = outboundStore.publishReceived(messageId); if (ref != null) { Message m = MQTTUtil.createPubRelMessage(session, getManagementAddress(), messageId); session.getServerSession().send(m, true); session.getServerSession().individualAcknowledge(ref.getB(), ref.getA()); } else { session.getProtocolHandler().sendPubRel(messageId); } } catch (ActiveMQIllegalStateException e) { log.warn("MQTT Client(" + session.getSessionState().getClientId() + ") attempted to Ack already Ack'd message"); } }
void handlePubRec(int messageId) throws Exception { try { Pair<Long, Long> ref = outboundStore.publishReceived(messageId); if (ref != null) { Message m = MQTTUtil.createPubRelMessage(session, getManagementAddress(), messageId); session.getServerSession().send(m, true); session.getServerSession().individualAcknowledge(ref.getB(), ref.getA()); } else { session.getProtocolHandler().sendPubRel(messageId); } } catch (ActiveMQIllegalStateException e) { log.warn("MQTT Client(" + session.getSessionState().getClientId() + ") attempted to Ack already Ack'd message"); } }
@Override public synchronized RoutingStatus send(Transaction tx, Message messageParameter, final boolean direct, boolean noAutoCreateQueue, RoutingContext routingContext) throws Exception { final Message message = LargeServerMessageImpl.checkLargeMessage(messageParameter, storageManager); if (server.hasBrokerMessagePlugins()) { server.callBrokerMessagePlugins(plugin -> plugin.beforeSend(this, tx, message, direct, noAutoCreateQueue)); } final RoutingStatus result; try { // If the protocol doesn't support flow control, we have no choice other than fail the communication if (!this.getRemotingConnection().isSupportsFlowControl() && pagingManager.isDiskFull()) { ActiveMQIOErrorException exception = ActiveMQMessageBundle.BUNDLE.diskBeyondLimit(); this.getRemotingConnection().fail(exception); throw exception; } //large message may come from StompSession directly, in which //case the id header already generated. if (!message.isLargeMessage()) { long id = storageManager.generateID(); // This will re-encode the message message.setMessageID(id); }