Package com.sun.messaging.jmq.jmsserver.core

Examples of com.sun.messaging.jmq.jmsserver.core.PacketReference


            } else {
                logger.log(logger.FORCE,
                    BrokerResources.I_RECONSTRUCT_MSG_TXNLOG, mid);
            }

            PacketReference pr =
                PacketReference.createReference(pkt, did, null);

            try {
                dst.routeNewMessage(pr);
            } catch (SelectorFormatException e) {
View Full Code Here


    // TO DO
    // This should use existing routing
   
    logger.log(Logger.FORCE, BrokerResources.I_RECONSTRUCT_MSG_TXNLOG,
        mid);
    PacketReference pr = PacketReference.createReference(pkt, dst.getDestinationUID(), null);
        if(pr.isExpired())
        {
          String msg ="not routing expired message on transaction log replay "+mid;
          logger.log(Logger.INFO, msg);
          return;
        }
View Full Code Here

  }

 
  public void acknowledgeOnReplay(Destination dst, SysMessageID mid,
      ConsumerUID iid) throws IOException, BrokerException {
    PacketReference ref = dst.getMessage(mid);
    boolean allAcked = false;
    if (ref != null) {
      allAcked = ref.acknowledgedOnReplay(iid, iid);
      if (Store.getDEBUG()) {
        String msg = getPrefix() + " acknowledgedOnReplay  " + mid
            + " allAcked =" + allAcked;
        logger.log(Logger.INFO, msg);
      }
View Full Code Here

          : DestType.DEST_TYPE_TOPIC);
      Destination dest = Destination.getDestination(destId.getName(),
          type, true, true);
      dest.load();

      PacketReference pr = dest.getMessage(mid);
      if (pr == null) {
        // could have been acknowledged already?
       
        // TO DO check this further
        String msg = " could not find packet for replayed message ack "
View Full Code Here

      if (messageID == null)  {
    throw new BrokerException("Message ID not specified");
      }

      SysMessageID sysMsgID = SysMessageID.get(messageID);
      PacketReference pr = Destination.get(sysMsgID);

      if (pr != null)  {
                d.removeMessage(sysMsgID, RemoveReason.REMOVED_OTHER);
          logger.log(Logger.INFO, "Deleted from destination "
      + destinationName
View Full Code Here

      }

      d.load();

      SysMessageID sysMsgID = SysMessageID.get(messageID);
      PacketReference pr = Destination.get(sysMsgID);

      if (pr != null)  {
    /*
     * Need to check if message types match
     */
                int oldPacketType = pr.getPacket().getPacketType();
    Integer newPacketType = (Integer)messageBody.get("MessageBodyType");

    if (oldPacketType != newPacketType.intValue())  {
        throw new BrokerException(
      "Existing message and new message types do not match.");
View Full Code Here

    public static boolean removeDeadMessage(SysMessageID sysid,
        String comment, Throwable exception, int deliverCnt,
         Reason r, String broker)
        throws IOException, BrokerException
    {
        PacketReference ref = get(sysid);
        Destination d = ref.getDestination();
        return d.removeDeadMessage(ref, comment, exception,
                                   deliverCnt, r, broker);
    }
View Full Code Here

        // first make sure we have the room to put it on the
        // queue ... if we dont, an exception will be thrown
        // from queue Message
        boolean route = false;
        PacketReference ref = null;
        try {
            newp.generateSequenceNumber(false);
            newp.generateTimestamp(false);
            newp.fill(p);
            newp.setProperties(props);

            if (truncateBody) {
                newp.setMessageBody(new byte[0]);
            }
   
            ref = PacketReference.createReference(
                   newp, deadMessageQueue.getDestinationUID(), null);
            ref.overrideExpireTime(0);
            ref.clearExpirationInfo();
            ref.setTimestamp(System.currentTimeMillis());
            synchronized (deadMessageQueue) {
                ref.setSequence(deadMessageQueue.seqCnt++);
            }
            routeMoveAndForwardMessage(pr, ref, deadMessageQueue);
        } catch (Exception ex) {
            // depending on the type, we either ignore or throw out
            if (reason == RemoveReason.UNDELIVERABLE ||
                reason ==  RemoveReason.ERROR) {
                    if (ex instanceof BrokerException) {
                        throw (BrokerException) ex;
                    }
                    throw new BrokerException(
                        br.getKString( BrokerResources.X_DMQ_MOVE_INVALID), ex);
            }
            if (DEBUG || useVerbose) {
                logger.logStack(Logger.WARNING, BrokerResources.W_DMQ_ADD_FAILURE,
                     pr.getSysMessageID().toString(), ex);
            }

        }
        if (  (DEBUG || useVerbose) && useDMQforMsg ) {
             String args[] = { pr.getSysMessageID().toString(),
                      pr.getDestinationUID().toString(),
                      lookupReasonString(reason,
                  receivedTime, expiredTime, senderTime) };
             logger.log(Logger.INFO, BrokerResources.I_DMQ_MOVING_TO_DMQ,
                    args);
        }

        ref.unload();
       
    }
View Full Code Here

     */
    protected PacketReference _replaceMessage(SysMessageID old, Hashtable addProps,
                          byte[] data)
        throws BrokerException, IOException
    {
        PacketReference ref = get(old);
        long oldbsize = ref.byteSize();

        ArrayList subs = new ArrayList();
        Consumer c = null;
        Iterator itr = getConsumers();
        while (itr.hasNext()) {
            c = (Consumer)itr.next();
            if (c instanceof Subscription) {
                if (c.unrouteMessage(ref)) {
                    subs.add(c);
                }
            }
        }

        SysMessageID newid = ref.replacePacket(addProps, data);
        destMessages.remove(old);
        destMessages.put(newid, ref);
        synchronized(this.getClass()) {
            totalbytes += (ref.byteSize() - oldbsize);
        }
        removePacketList(old, ref.getDestinationUID());
        packetlistAdd(newid, ref.getDestinationUID());

        Subscription sub = null;
        itr = subs.iterator();
        while (itr.hasNext()) {
            sub = (Subscription)itr.next();
View Full Code Here

    // get messages for this txn
    List<SysMessageID> sentMessageIds = txnInfo.getPublishedMessages();
    Iterator<SysMessageID> msgIter = sentMessageIds.iterator();
    while (msgIter.hasNext()) {
      SysMessageID mid = msgIter.next();
      PacketReference packRef = Destination.get(mid);
      if (packRef == null) {
        String msg = getPrefix()
            + " convertLocalToTxnLogFormat: can not find packet for sent msg "
            + mid + " in txn " + txnInfo;
        logger.log(Logger.WARNING, msg);
      } else {

        DestinationUID destUID = packRef.getDestination()
            .getDestinationUID();
        ConsumerUID[] interests = store.getConsumerUIDs(destUID, mid);
        TransactionWorkMessage twm = new TransactionWorkMessage();
        twm.setStoredInterests(interests);
        twm.setPacketReference(packRef);
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.core.PacketReference

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.