Ejemplo n.º 1
0
 private ContentHeaderBody createPersistentContentHeader() {
   ContentHeaderBody chb = new ContentHeaderBody();
   BasicContentHeaderProperties bchp = new BasicContentHeaderProperties();
   bchp.setDeliveryMode((byte) 2);
   chb.setProperties(bchp);
   return chb;
 }
Ejemplo n.º 2
0
  protected IncomingMessage message(final boolean immediate, long size) throws AMQException {
    MessagePublishInfo publish =
        new MessagePublishInfo() {

          public AMQShortString getExchange() {
            return null;
          }

          public void setExchange(AMQShortString exchange) {
            // To change body of implemented methods use File | Settings | File Templates.
          }

          public boolean isImmediate() {
            return immediate;
          }

          public boolean isMandatory() {
            return false;
          }

          public AMQShortString getRoutingKey() {
            return null;
          }
        };

    ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
    BasicContentHeaderProperties props = new BasicContentHeaderProperties();
    contentHeaderBody.setProperties(props);
    contentHeaderBody.bodySize = size; // in bytes
    IncomingMessage message = new IncomingMessage(publish);
    message.setContentHeaderBody(contentHeaderBody);

    return message;
  }
Ejemplo n.º 3
0
 static ContentHeaderBody getContentHeader(FieldTable headers) {
   ContentHeaderBody header = new ContentHeaderBody();
   header.setProperties(getProperties(headers));
   return header;
 }