Package org.springframework.messaging

Examples of org.springframework.messaging.MessageDeliveryException


    if (channel instanceof MessageChannel) {
      this.messagingTemplate.send((MessageChannel) channel, message);
    } else if (channel instanceof String) {
      this.messagingTemplate.send((String) channel, message);
    } else {
      throw new MessageDeliveryException(message,
          "a non-null reply channel value of type MessageChannel or String is required");
    }
  }
View Full Code Here


    long timeout = this.sendTimeout;
    boolean sent = (timeout >= 0 ? channel.send(message, timeout) : channel.send(message));

    if (!sent) {
      throw new MessageDeliveryException(message,
          "failed to send message to channel '" + channel + "' within timeout: " + timeout);
    }
  }
View Full Code Here

    long timeout = this.sendTimeout;
    boolean sent = (timeout >= 0 ? this.messageChannel.send(message, timeout) : this.messageChannel.send(message));

    if (!sent) {
      throw new MessageDeliveryException(message,
          "Failed to send message to destination '" + destination + "' within timeout: " + timeout);
    }
  }
View Full Code Here

      if (errorDescription != null) {
        if (logger.isWarnEnabled()) {
          logger.warn(errorDescription + ":" + message);
        }
        if (GenericMessagingTemplate.this.throwExceptionOnLateReply) {
          throw new MessageDeliveryException(message, errorDescription);
        }
      }

      return true;
    }
View Full Code Here

  protected void handleMessageInternal(Message<?> message) {
    String sessionId = SimpMessageHeaderAccessor.getSessionId(message.getHeaders());

    if (!isBrokerAvailable()) {
      if (sessionId == null || SYSTEM_SESSION_ID.equals(sessionId)) {
        throw new MessageDeliveryException("Message broker not active. Consider subscribing to " +
            "receive BrokerAvailabilityEvent's from an ApplicationListener Spring bean.");
      }
      SimpMessageType messageType = SimpMessageHeaderAccessor.getMessageType(message.getHeaders());
      if (logger.isErrorEnabled() && SimpMessageType.CONNECT.equals(messageType)) {
        logger.error("Broker not active. Ignoring " + message);
View Full Code Here

        ListenableFuture<Void> future = super.forward(message, accessor);
        future.get();
        return future;
      }
      catch (Throwable ex) {
        throw new MessageDeliveryException(message, ex);
      }
    }
View Full Code Here

    catch (Exception ex) {
      chain.triggerAfterSendCompletion(message, this, sent, ex);
      if (ex instanceof MessagingException) {
        throw (MessagingException) ex;
      }
      throw new MessageDeliveryException(message,"Failed to send message to " + this, ex);
    }
    catch (Error ex) {
      MessageDeliveryException ex2 =
          new MessageDeliveryException(message, "Failed to send message to " + this, ex);
      chain.triggerAfterSendCompletion(message, this, sent, ex2);
      throw ex2;
    }
  }
View Full Code Here

        triggerAfterMessageHandled(message, ex);
        if (ex instanceof MessagingException) {
          throw (MessagingException) ex;
        }
        String description = "Failed to handle " + message + " to " + this + " in " + this.messageHandler;
        throw new MessageDeliveryException(message, description, ex);
      }
      catch (Error ex) {
        String description = "Failed to handle " + message + " to " + this + " in " + this.messageHandler;
        triggerAfterMessageHandled(message, new MessageDeliveryException(message, description, ex));
        throw ex;
      }
    }
View Full Code Here

        final Message message = new DefaultMessage("<TestRequest><Message>Hello World!</Message></TestRequest>");
       
        reset(messagingTemplate, channel);
       
        messagingTemplate.send(eq(channel), anyObject(org.springframework.messaging.Message.class));
        expectLastCall().andThrow(new MessageDeliveryException("Internal error!")).once();
       
        replay(messagingTemplate, channel);

        try {
            endpoint.createProducer().send(message, context);
View Full Code Here

TOP

Related Classes of org.springframework.messaging.MessageDeliveryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.