You can only get/peek messages on your own handle's queue for security 
reasons.  That it, only the queue's handle is allowed to manipulate the 
contents of its queue via a GET, PEEK, or DELETE request.  So, a GET/PEEK 
request must be submitted to the QUEUE service by the handle whose queue 
you want to retrieve/remove messages from.  That's why sub-section 
"Security" in sections "8.13.3 GET/PEEK" and "8.13.4 DELETE" says:

  "These commands are only valid with respect to the submitting process' 
queue and if submitted to the local machine."

Section "8.13.3 GET/PEEK" in the STAF User's Guide defines the HANDLE 
option on a GET/PEEK request for the QUEUE service as follows:

  "HANDLE specifes that you want to retrieve/remove a message originating 
from a process with the given handle.  The default is any handle.  You may 
specify this option multiple times."

So, it's not the handle whose queue you want to get/peek messages from. 
It's the handle that queued the message, thus, allowing you to get 
messages that were sent by a particular handle.  The HANDLE option for a 
GET/PEEK request is not defined the same as the HANDLE option for a LIST 
request.   A LIST request submitted to the QUEUE service (which doesn't 
manipulate the contents of a queue) can list messages for another handle 
by specifying the HANDLE option (assuming you have the required trust 
level). 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




Joe Malek <j.ma...@f5.com> 
03/06/2009 12:14 PM

To
"staf-users@lists.sourceforge.net" <staf-users@lists.sourceforge.net>
cc

Subject
[staf-users] Startup notice and queue messages






Hi,

                 I'm new to STAF and am building a new environment using 
dynamically provisioned virtual machines as test servers and my goal is to 
maintain a respool of ready vms to dole out workloads.  The vm will start 
staf on its own and notify the workload manager according to the test 
server's staf.cfg:

NOTIFY ONSTART MACHINE staf PRIORITY 3 HANDLE 26
NOTIFY ONSHUTDOWN MACHINE staf HANDLE 26

I see the startup and shutdown messages traverse the network between the 
nodes (using a protocol analyzer) and can find them on the workload 
manager in the queue for handle 26 with:

staf local QUEUE LIST HANDLE 26

as evidenced by

Response
--------
P Date-Time         Machine      Handle Name H# User             Type 
Message
- ----------------- ------------ ----------- -- ---------------- ------ 
-------
3 20090305-17:05:03 tcp://vdixpc STAF_Proces 1  none://anonymous STAF/S
                    lie...@6500  s                               tart
3 20090305-17:09:28 tcp://vdixpc STAF_Proces 1  none://anonymous STAF/S
                    lie...@6500  s                               tart
3 20090306-09:57:06 tcp://vdixpc STAF_Proces 1  none://anonymous STAF/S
                    lie...@6500  s                               tart
5 20090305-17:09:16 tcp://vdixpc STAF_Proces 1  none://anonymous STAF/S
                    lie...@6500  s                               hutdow
                                                                 n
5 20090305-17:10:46 tcp://vdixpc STAF_Proces 1  none://anonymous STAF/S
                    lie...@6500  s                               hutdow

but I cannot seem to access the messages in the queue with the GET/PEEK 
commands.

C:\STAF>staf local QUEUE PEEK PRIORITY 3 HANDLE 26
Error submitting request, RC: 29

C:\STAF>staf local QUEUE GET PRIORITY 3 HANDLE 26
Error submitting request, RC: 29

If I add the WAIT command to the request and restart staf on the 
worker-bee messages are added to the queue but don't aren't found by 
GET/PEEK.  This issue doesn't seem unique to start/stop notices either - 
I'm able to enter messages into the queue on the local server and also 
cannot retrieve those messages with GET/PEEK.  After I get this sorted 
out, I'd like to move to the event manager service so that the machine can 
be added to the respool automatically; but I thought I'd start out simpler 
first.

RC 29 indicates to me that there's no element found in the queue, and 
based on the output of the LIST command, that doesn't appear to be the 
case.  STAF is at version 3.3.2 on both hosts.

What am I missing here?

Thanks!

--joe

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, 
CA
-OSBC tackles the biggest issue in open source: Open Sourcing the 
Enterprise
-Strategies to boost innovation and cut costs with open source 
participation
-Receive a $600 discount off the registration fee with the source code: 
SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to