qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mick goulish" <m...@redhat.com>
Subject Re: Review Request: browse-only queues
Date Thu, 06 Sep 2012 13:52:02 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/6943/
-----------------------------------------------------------

(Updated Sept. 6, 2012, 1:52 p.m.)


Review request for qpid, Alan Conway, Gordon Sim, and Kenneth Giusti.


Description
-------

browse-only queues

prevent consumer from acquiring, and prevent queue from dequeing -- no change to any class
except Queue, and QueueSettings.


yes, questions: 

  1. is it OK to *not* change anything else.  i.e. i don't see that read-credit should be
affected.

  2. also, i did not want to change anything except Queue -- i.e. no change to Consumer cursor.
 Let it think that it is consuming -- but Queue keeps messages.  This might allow queue to
change back and forth from browse-only to normal, if we ever care.


Diffs
-----

  trunk/qpid/cpp/src/qpid/broker/Queue.cpp 1376905 
  trunk/qpid/cpp/src/qpid/broker/QueueSettings.h 1376905 
  trunk/qpid/cpp/src/qpid/broker/QueueSettings.cpp 1376905 

Diff: https://reviews.apache.org/r/6943/diff/


Testing
-------

passed make check except for 1 HA test, on recent trunk
Create queue with "browse-only" arg, load 10 messages, and then see that consumer can 'consume'
any number of time, but same messages are always there.


Here are some scripts for testing:

---- script: start_broker -------
#! /bin/bash


PORT=5801
TRUNK=/home/mick/redhat/trunk
QPIDD=${TRUNK}/qpid/cpp/src/qpidd
QPID_CONFIG=${TRUNK}/qpid/tools/src/py/qpid-config
SPOUT=${TRUNK}/qpid/cpp/examples/messaging/spout
DRAIN=${TRUNK}/qpid/cpp/examples/messaging/drain
LOG=/tmp/qpidd.log


rm -f ${LOG}


echo "Starting broker..."
${QPIDD}     \
  --auth=no  \
  --log-enable info+ \
  --log-to-file ${LOG} \
  --log-hires-timestamp=yes \
  --log-source=yes \
  -p ${PORT} \
  -d
echo "Broker started."
---- end script -----------------


---- script: load_messages -------
#! /bin/bash


PORT=5801
TRUNK=/home/mick/redhat/trunk
QPIDD=${TRUNK}/qpid/cpp/src/qpidd
QPID_CONFIG=${TRUNK}/qpid/tools/src/py/qpid-config
SPOUT=${TRUNK}/qpid/cpp/examples/messaging/spout
DRAIN=${TRUNK}/qpid/cpp/examples/messaging/drain
LOG=/tmp/qpidd.log


echo "============================================"  >> ${LOG}
echo "Loading the messages"                        >> ${LOG}
echo "============================================"  >> ${LOG}
echo "Loading the messages"                       

sleep 3
  
  
  # address was: 'q; {create: always, node:{ type: queue }}'
  
COUNT=10
echo "Sending $COUNT messages..."
${SPOUT} \
  -c 10 \
  --broker "localhost:${PORT}" \
  --content "All Work and No Play Make Mick a Dull Boy" \
  'q; {create: always, node:{type:queue , x-declare:{arguments:{"browse-only":1}}}}'

echo " "
echo "Done sending messages."
echo " "
---- end script ------------------


---- script: consume -------------
#! /bin/bash


PORT=5801
TRUNK=/home/mick/redhat/trunk
QPIDD=${TRUNK}/qpid/cpp/src/qpidd
QPID_CONFIG=${TRUNK}/qpid/tools/src/py/qpid-config
SPOUT=${TRUNK}/qpid/cpp/examples/messaging/spout
DRAIN=${TRUNK}/qpid/cpp/examples/messaging/drain
LOG=/tmp/qpidd.log


echo "============================================"  >> ${LOG}
echo "Consuming the messages"                        >> ${LOG}
echo "============================================"  >> ${LOG}
echo "Consuming the messages"                       

sleep 5
  
${DRAIN} \
  --broker 'localhost:5801' \
  'q;'


echo "done."
---- end script ------------------


---- script: browse --------------
#! /bin/bash


PORT=5801
TRUNK=/home/mick/redhat/trunk
QPIDD=${TRUNK}/qpid/cpp/src/qpidd
QPID_CONFIG=${TRUNK}/qpid/tools/src/py/qpid-config
SPOUT=${TRUNK}/qpid/cpp/examples/messaging/spout
DRAIN=${TRUNK}/qpid/cpp/examples/messaging/drain
LOG=/tmp/qpidd.log

echo "============================================"  >> ${LOG}
echo "Browsing the messages"                        >> ${LOG}
echo "============================================"  >> ${LOG}
echo "Browsing the messages"                       

sleep 5

${DRAIN} \
  --broker 'localhost:5801' \
  'q; {mode: browse}'
  

echo "done."
---- end script ------------------


Thanks,

mick goulish


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message