Queue with Iterator

How hard is to implement an Iterator in a Queue?

Most people in these forums would never bother. They'd just use the LinkedList in the API and get on with life.
That said, most of us did do the hard work of writing our own (mine was back in the days of Turbo Pascal) - so we understand how the API LinkedList is implemented.
So, let's turn this around and make into a question for YOU: Given your knowledge of how linked lists are implemented, what challenges do you think there would be in implementing an iterator for it?
Ensure that your answer accounts for changes that may be made to the queue while the iterator is still active.
I'm going to set a watch on this topic - if you reply and give a good shot at the answer, I'll see if I can provide some things for you to think about.
Cheers!
- K

Similar Messages

  • How to use a queue with dynamic data

    When using a collector I have found that it significantly slows down my loop times. I am using LabView7.1 on a Dell PC with Windows XP.  If I use a queue with dynamic data do you think that will require less of my processor and allow for faster loop speeds?
    I have created a queue using dynamic data in one loop and I want to retrieve all available samples each iteration in a slower loop. If I use the flush queue I get a 1d array of dynamic data. What is the best way to convert the 1d array of dynamic data so that the array of dynamic data is consolidated back into a single dynamic data type? Any help would be much appreciated.

    Hi Dennis,
    You could for instance wire the array to an auto-indexed for loop. I attach an example. I assume you wish to concatenate the arrays a singel waveform.
    Hope it helps,
    Pelle S
    District Sales Manager
    National Instruments Sweden
    Attachments:
    Dynamic queue.vi ‏245 KB

  • How to block on MQ queue with MQControl

    I'm using WL 8.1SP4.
    I'm trying to use the com.bea.control.MQControl class. It seems like there is no way to "block" on a queue with this. It appears that the various "getMessageAs..." methods will just throw a ResourceException if there is no message on the queue. Failing a blocking capability, I have to implement a complicated wait/retry loop so the app doesn't spin waiting for a message.
    Alternatively, if my jpd has a Subscription node for the queue, if I get to that node, does that mean that there is definitely a message on the queue at that point? It would be ok if I could execute the process only when there is a message on the queue, and I could restart it each time.

    I figured out how to do this. The MQMDHeaders instance, which gets passed to the "getMessageAsString()" method, has a "waitInterval" property, which when set to "-1", will wait forever.
    What I'm not sure about, however, is whether it's valid to block for resources inside a JPD.

  • How to get all the recipients of a server queue with powershell

    Hello,
    I have a queue who remains "full" because there was a bounce email sent to invalid addresses. I am looking for an easy way to list all the recipients with invalid addresses.
    I can have the list of emails in the queue with this command :
    get-queue -identity ServerName\Shadow\37057 | get-message
    But I am unable to list the recipient address with this one :
    get-queue -identity POST1MTY\Shadow\37057 | get-message -IncludeRecipient
    Can somebody help me with this ?
    Thank you in advance for your help.
    zigune

    Hi zigune,
    Thank you for your question.
    We could try to the following command to get the recipient address:
    Get-MessageTrackingLog –server “servername” | FL sender,Event-id,recipients | export-csv C:\test\test.csv
    Then, we could use log parser to view csv file for invalid recipient address, we could download log parser tool by the following link:
    http://www.microsoft.com/en-us/download/details.aspx?id=24659
    In other way, we could also try adding the “-IncludeRecipientInfo” in command:
    http://technet.microsoft.com/en-us/library/bb124738(v=exchg.150).aspx
    If there are any questions regarding this issue, please be free to let me know. 
    Best Regard,
    Jim

  • Message stuck in Adapter Engine queue with status "Delivering"

    Hi All,
    I have a File to File EOIO scenario. The messages are sucessfully delivered from IE to AE. All entries have a chequered flag in SXMB_MONI. No messages are stuck in IE queue (SMQ2). But the message is stuck in AE queue with status "Delivering". I can not resend or cancel the message coz the status is "delivering".
    The reason it is in "delivering" status is due to some config error that I made in Communication Channel FTP parameters. Now it is corrected. But how do I deal with this message now?
    Restart of server is not an option here. Is there are place I can delete the message from AE queue?
    Thanks
    Jaishankar

    You can see the queues status (and number of stuck entries etc) through the link:
    http://<host>:<port>/MessagingSystem/monitor/systemStatus.jsp
    There, you can maintain the queues.
    There is also a link for the EOIO Sequence Monitor:
    http://<host>:<port>/MessagingSystem/monitor/sequenceMonitor.jsp
    There you can see the stuck messages and maintain these.
    Make sure to handle the proper message IDs.
    All of these are acessible through the Messaging System main page:
    http://<host>:<port>/MessagingSystem/
    Regards,
    Henrique.

  • Reading Advance Queuing with XMLType payload and JDBC Driver character encoding

    Hi
    I've got a problem retrieving the message from the queue with XMLType payload in Java.
    It was working fine in 10g database but after the switch to 11g it returns corrupted string instead of real XML message. Database NLS_LANG setting is AL32UTF8
    It is said that JDBC driver should deal with that automatically but it obviously don't in this case. When I dequeue the message using database functionality (DBMS_AQ package) it looks fine but not when using JDBC driver so Ithink it is character encoding issue or so. The message itself is enqueued by the database and supposed to be retrieved by dedicated EJB.
    Driver file used: ojdbc6.jar
    Additional libraries: aqapi.jar, xdb.jar
    All file taken from 11g database installation.
    What shoul dI do to get the xml message correctly?

    Do you mean NLS_LANG is AL32UTF8 or the database character set is AL32UTF8? What is the database character set (SELECT value FROM nls_database_parameters WHERE parameter='NLS_CHARACTERSET')?
    Thanks,
    Sergiusz

  • ESB 10.1.3.1 Not Connecting to AQ QUEUE with error

    We are having problems getting the ESB service to connect to an AQ queue to dequeue messages;
    Platform: SOLARIS 10 SPARC 64
    Version: 10.1.3.1 ESB
    Database: 10.2.0.2
    Scenario: BPEL process enqueues message successfully. ESB process not able to connect to dequeue.
    Reproduceable steps:
    1) Create QUEUE table, queue and start queue for a user with Roles AQ_Administrator_ROLE, AQ_USER_ROLE, DBA;
    2) Enqueue message. Message payload type is RAW;
    3) ESB service defines an inbound adapter service to above and succesfully deploys project to esb container;
    4) Logs report the following errors:
    ERROR1) >JCA: MessageReader_ReadMessage: Could not create XML document carrying AQ Head
    ers: [Ljava.lang.StackTraceElement;@d7f3e3</MSG_TEXT>
    ERROR2) <SUPPL_DETAIL><![CDATA[java.lang.NullPointerException
    at oracle.AQ.AQOracleQueue.dequeue(AQOracleQueue.java:1715)
    at oracle.AQ.AQOracleQueue.dequeue(AQOracleQueue.java:1290)
    at oracle.tip.adapter.aq.database.MessageReader.readMessage(MessageReader.java:400)
    at oracle.tip.adapter.aq.inbound.AQActivationSpecDequeuer.run(AQActivationSpecDequeu
    er.java:189)
    at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
    at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
    at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:81
    9)
    at java.lang.Thread.run(Thread.java:595)
    ]]></SUPPL_DETAIL>
    VERIFICATION: First of all, the BPEL process is successfully submitting messages to AQ QUEUE so AQ is configured properly at the database level. We verified queue table has a message in it via sql plus;
    RELATED ISSUES:
    1) JDEV designer is not finding queues with payload types such as JMS_TEXT_MESSAGE. We were forced to use RAW. There is probably a bug in JDEV IDE regards its inability to view valid queues in the database simply based on payload. This is easily reproducible.
    2) log.xml is very unhelpful way to view a log. This should be discarded in OAS in future releases as it is not practical.

    Yes, WebLogic 10.1.3.6 can interoperate with 9.2. SAF agents are "Store and Forward" agents, so they'd need to run in the source cluster. If you need to get messages from a remote destinations into a local SAF "imported destinations", or just a plain-old destination, then perhaps the best option would be to deploy a simple MDB on the 10.3.6 cluster (some layered products can setup such an MDB for you).
    I'm not familiar with ESB, but assume that it already provides tooling for pulling messages from remote destinations (I assume a product like ESB is designed to try and more-or-less hide JMS details from the user by providing layered tooling...). You might be able to get help from an ESB newsgroup. If this doesn't help, you may also want to see the JMS interop FAQ:
    http://docs.oracle.com/cd/E21764_01/web.1111/e13727/interop.htm#JMSPG553
    BTW, It's not clear to me why you need SAF Agents in this use case.
    Tom

  • Purge a queue with JAVA API

    Hi,
    Is it possible to purge a queue with the JAVA API ?
    I have not found anything ...
    I am also trying to browse archived messages (state 2), the "browseQueue" method does only browse the ready messages (state 0).
    Is it possible to browse archived messages ?? (in java)
    Thanks in advance.

    found it, I had to write
    "ormi://<some-ip>:12401/orabpel" for java.naming.provider.url

  • Queue with callback function not dequeuing

    Hi,
    I would like to ask you for help or for a hint regarding our problem with the queue:
    A trigger is enqueuing to a queue. This works fine, but the callback function is never called. The queue already worked for a while, but since i changed something at the procedure called by the callback it does not work anymore.
    I already have tried the following:
    -Stopping and restarting
    -Dropping and recreating (with the scheduler having no jobs anymore)
    -Dropping, restarting the database and recreating
    None of these worked. Where do I fail, when considering that the queue with the same scripts worked already? I post the script for creating the queue and adding the subscriber:
    CREATE OR REPLACE TYPE pat_history_queue_payload_type AS OBJECT
    ( TSTAMP VARCHAR2(22 CHAR),
    TYP VARCHAR2(10 CHAR),
    DELTA_MENGE NUMBER,
    ORIGIN VARCHAR2(1 CHAR),
    TEXT VARCHAR2(1000 CHAR),
    QL_TSTAMP VARCHAR2(22 CHAR)
    BEGIN
    DBMS_AQADM.CREATE_QUEUE_TABLE (
    queue_table => 'pat_history_queue_table',
    queue_payload_type => 'pat_history_queue_payload_type',
    multiple_consumers => TRUE
    END;
    BEGIN
    DBMS_AQADM.CREATE_QUEUE (
    queue_name => 'pat_history_queue',
    queue_table => 'pat_history_queue_table',
    max_retries => 10
    DBMS_AQADM.START_QUEUE (
    queue_name => 'pat_history_queue'
    END;
    BEGIN
    DBMS_AQADM.ADD_SUBSCRIBER (
    queue_name => 'pat_history_queue',
    subscriber => SYS.AQ$_AGENT(
    'pat_history_queue_subscriber',
    NULL,
    NULL )
    DBMS_AQ.REGISTER (
    SYS.AQ$_REG_INFO_LIST(
    SYS.AQ$_REG_INFO(
    'pat_history_queue:pat_history_queue_subscriber',
    DBMS_AQ.NAMESPACE_AQ,
    'plsql://PAT.HISTORY_QUEUE_DISTRIBUTION.CALLBACK',
    HEXTORAW('FF')
    1
    END;
    The function CALLBACK which is called by the queue, is never called, I checked that with log messages. Also the package that contains the function is compiled ok.
    Thanks.
    Roland

    Hi,
    Does the subscription show up correct in sys.reg$ ?
    Regards,
    Harry
    http://dbaharrison.blogspot.com/

  • Best way to iniitialize a queue with array elements

    Hi Guys
    I'm looking for a bit of performance optimization..  
    I'm developing a noise measurement application using LV8.6 and Win Xp /Win 7.
    To put it very simple I have a loop that samples, and a loop that does the math. data is shipped in a queue, producer / consumer style.
    So far so good.. Question is - is there a specific and more optimized way to declare this queue?
    I was wondering if declaring the queue with an initialized array element of a fixed size (the number of samples pr. read from the sound card will be known at runtime) would produce a queue that would be less heavy on dynamic allocation of memory compared to a queue obtained using a simple control no values.
    I've attached a screen dump to maybe make the question more obvious..
    I've been thru the "clear as mud" thread, as recommended in other threads that covers this topic - but i gets very high tech, and I kind of lost my way in it.. So looking for a more simple "you should use solution #x, because..."
    Thank you in advance. 
    Solved!
    Go to Solution.

    I believe (but am not sure) RT FIFOs will allocate this memory for you ahead of time. But, remember they are not deterministic on windows. You need to wire an array constant of the correct size into the FIFO read function also to avoid memory allocation, which is easy to overlook. It's worth looking into, if nothing else, assuming you have RT functions available. WIth this method, the queue size needs to be set, and you run the risk of overflowing and losing elements if not handled correctly. 
    Just throwing other options out there.
    CLA, LabVIEW Versions 2010-2013

  • PLSQL Notification on a multi-subscriber queue with sys.aq$_jms_text_messag

    Hi all,
    I am trying to get PLSQL notification working on a multi subscriber queue with sys.aq$jms_text_message as the payload type. The commands to create my queue are as follows:
    dbms_aqadm.create_queue_table(
    queue_table => 'SOA_JMS.RJMTESTxx_QTAB',
    multiple_consumers => true,
    queue_payload_type => 'sys.aq$_jms_text_message'
    dbms_aqadm.create_queue(
    queue_name=>'RJMTESTQ',
    queue_table => 'SOA_JMS.RJMTESTxx_QTAB',
    retention_time => 86400, --Keep processed messages for 24 hours
    max_retries => 3,
    retry_delay => 1
    dbms_aqadm.start_queue('RJMTESTQ');
    dbms_aqadm.add_subscriber(
    queue_name => 'SOA_JMS.RJMTESTQ',
    subscriber => sys.aq$_agent('SUBSCRIP1',null,0),
    rule => NULL,
    transformation => NULL,
    queue_to_queue => FALSE,
    delivery_mode => dbms_aqadm.persistent
    I then create a procedure with the following signature:
    create or replace procedure SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1(
    p_context in raw,
    p_reginfo in sys.aq$_reg_info,
    p_descr in sys.aq$_descriptor,
    p_payload in raw,
    p_payloadl in number
    And register it as follows:
    reginfo := sys.aq$_reg_info(
    'SOA_JMS.RJMTESTQ:SUBSCRIP1',
    DBMS_AQ.NAMESPACE_AQ,
    'plsql://SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1?PR=0',
    --utl_raw.cast_to_raw('STANDARDJMS')
    HEXTORAW('FF')
    reg_list := sys.aq$_reg_info_list(reginfo);
    dbms_aq.register(reg_list,1);
    The problem is the notifications are not firing as they should be.
    I have done some tracing and found an error:
    Error in PLSQL notification of msgid:BA964334E5A057A4E040C69BAF397075
    Queue :"SOA_JMS"."RJMTESTQ"
    Consumer Name :SUBSCRIP1
    PLSQL function :SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_1
    : Exception Occured, Error msg:
    ORA-00604: error occurred at recursive SQL level 2
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EXCEPTION_QUEUE_NOFIFYCB_1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    This says that the parameters I have for my procedure is wrong. Looking through the documents I think it is something to do with the ?PR=0 used in the register call, but I can’t find any documentation telling me what the required parameters are.
    Does anyone here know?
    Thanks
    Robert

    Hi,
    I have found the solution and I am posting here in case it helps anyone else.
    The paramater names must match the callback not just the types and in/out.
    So the following works:
    create or replace procedure SOA_JMS.EXCEPTION_QUEUE_NOFIFYCB_2(
    context in raw,
    reginfo in sys.aq$_reg_info,
    descr in sys.aq$_descriptor,
    payload in raw,
    payloadl in number
    Robert

  • Migration from Serial polling to Serial queue with event handler

    Hi, I am trying to migrate from classical serial polling communications to serial queue with "event handler" for the buttons pressed by the user. I have placed four while loops, one for the event handler, a second one for serial reading, a third one for serial writing (depending on what button was pressed) and the last one for processing what was read from the serial reading while loop, via a queue.
    My attached device reads the signals from 8 sensor ( 4 temperature and another 4 temperature plus humidity in the same sensor ) and send them via serial to Lavbiew.
    First of all, only once just after running the LV program, I must turn on my attached device with an ON command plus a carriage return after that the device will respond with the number of sensors plugged to it, disabling the corresponding buttons in the front panel. Then labview must wait until I pressed Acquire Button (event handler) and send a CF command plus what sensors to acquire plus a carriage return, then the device will respond continuously to labview with the sensor readings until I press the stop button (event handler), there is also another button to exit the program, also with event handler.
    I am having problems using the event handler and the queues because I am new using these structures, I have looked at  the LV examples but there is nothing concrete on using serial with event handler and queue.
    Take a look at my VI and you will soon notice what kind of problems I am having, any suggestions will welcome.
    Thank's in advance.
    Regards.
    Attachments:
    serial queue.zip ‏76 KB

    Hi Luisete,
    Maybe the problem arise because you are En- and DeQueue in parallel. You do a lot of things in parallel, that is nice if you are sure that one loop doesn't have to wait for another loop. Make sure you don't dequeue before enqueue.
    Hope this helps
    I never knew that the standard error cluster output could be wired directly to the loop control of a while loop.
    First time I see this

  • CFSTKE* Queues with few entries executing for long durations  (10 hrs)

    In APO 7.0 the CFSTKE* Queues with few entries executing for long durations  (10 hrs)
    Below are the FM from the queue 
    /SAPAPO/CIF_IRQ_REDUCT_INBOUND
    /SAPAPO/CIF_STOCK_INBOUND
    /SAPAPO/CIF_SL_DOC_INBOUND
    /SAPAPO/CIF_SL_DOC_INBOUND
    Do any one have the same problem and any fixes ?
    Thank You

    Hi Aravind,
    What is the status of your queue:
    Is it in status running, ready or sysfail?
    If it is in "Running" status since last 10 hours then check the following things:
    Check SM51 and see if you find a long running process, see if it is trying to do a sequential read on some table.
    If yes then ask your Basis team to run ST04 and see what index it is using,
    If that is also fine then ask them to check stat on that table.
    Builiding stat may help if a read on table is taking long time and index which is being picked up is correct.
    Your basis team should be able to help you.
    I hope it helps.
    Thanks,
    Anupam
    Edited by: Anupam Sengar on Aug 11, 2011 12:06 AM

  • How to notify the waiting queue with first-in-first-out?

    Could anyone know
    how to notify the waiting queue with first-in-first-out?
    I dont want to notify the waiting queue randomly!
    thanks~

    i assume you are referring to wait "queue" of threads waiting to be notified. while you can do this with some effort on your own part (it's not trivial), depending on what type of guarantees you want, you could use a ReentrantLock with the "fair" policy. it tries to be FIFO but doesn't guarantee it. if you need stronger guarantees, then you will have to code it yourself.
    note, that many of the reasons for using wait/notify explicitly are now handled with some of the concurrent utilities like BlockingQueue, so you may not need to code your own wait/notify logic.

  • Integration Oracle Advance Queue with OSB

    We are doing integration for Oracle Advance Queue with OSB.
    I created an AQ adapter in Jdev and generate the WSDL and XSD.
    I imported both WSDL and XSD in OSB Project.
    When i am configuring the business service and selecting the WSDl i am not able to select Binding and ports, is it due to any issue in WSDL?
    Please help.
    Thanks,
    Mihir Panda

    Hi again,
    I made some adjustments to your wsdl. I added the binding part and its reference to the appropriate port.
    Now I reckon, you should be able to do your thing:
    <wsdl:definitions
    name="enq"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/aq/Applicatio90/Project4/enq"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/aq/Applicatio90/Project4/enq"
    xmlns:opaque="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
    xmlns:obj1="http://xmlns.oracle.com/xdb/APPS"
    xmlns:ph="http://xmlns.oracle.com/pcbpel/adapter/aq/headers/payloadheaders/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <plt:partnerLinkType name="Enqueue_plt" >
    <plt:role name="Enqueue_role" >
    <plt:portType name="tns:Enqueue_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    <wsdl:types>
    <!-- Define AQ Headers = Payload Headers -->
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/aq/headers/payloadheaders/"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:obj1="http://xmlns.oracle.com/xdb/APPS" >
    <import namespace="http://xmlns.oracle.com/xdb/APPS" schemaLocation="xsd/APPS_WF_EVENT_T.xsd"/>
    <complexType name="enqHeaderCType" >
    <sequence>
    <!-- payload header -->
    <element name="PayloadHeader" type="xs:string" />
    </sequence>
    </complexType>
    <element name="enqHeader" type="ph:enqHeaderCType" />
    </schema>
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
    xmlns="http://www.w3.org/2001/XMLSchema" >
    <element name="opaqueElement" type="base64Binary" />
    </schema>
    </wsdl:types>
    <wsdl:message name="Enqueue_msg">
    <wsdl:part name="opaque" element="opaque:opaqueElement"/>
    </wsdl:message>
    <wsdl:message name="Header_msg">
    <wsdl:part name="Header" element="ph:enqHeader"/>
    </wsdl:message>
    <wsdl:portType name="Enqueue_ptt">
    <wsdl:operation name="Enqueue">
    <wsdl:input message="tns:Enqueue_msg"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="Enqueue_Binding" type="tns:Enqueue_ptt">
         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="Enqueue">
                   <soap:operation soapAction="put_your_own_URI_here"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
              </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="EnqueueService">
         <wsdl:port name="Enqueue_ptt" binding="tns:Enqueue_Binding">
              <soap:address location="No Target Adress"/>
         </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Good luck.
    Regards,
    Ronald

Maybe you are looking for

  • REPORT_ATTRIBUTE_ERROR_MESSAGE and SELECT-OPTIONS

    Hi, I'm still at a loss on how to use the REPORT_ATTRIBUTE_ERROR_MESSAGE on select-options using WDR_SELECT_OPTIONS. Do I need to create a Context Node and attributes in the view for the selection options I'm creating? Then, get the attributes of thi

  • What is a Transaction Variant?

    hello abap gurus, can u tell me what is a transaction variant and how does it works? i have a requirement that is to run an existing customized report program in the background. that means no user interface. i'm pretty new with abap programming. plea

  • Get the first photo in photo album

    Hi, I am new to iphone programming. How can I get the first image in photo album into an UIImage object? I can not use the ImagePicker because this will the initial image when user launches the app. Thanks, fm

  • Dropped iPad2 and it won't work

    Does anyone have any experience of this? I dropped it this afternoon, it slipped from the case it was in, and it landed only about a foot down but the screen shattered and I can't enter the passcode to turn it on. It won't sync with my laptop as I ca

  • Using HttpURLConnection on particular port

    Hi, I am using java.net.HttpURLConnection class to make http get/post request to some server in the program. Whenever this class opens up connection with the server, it uses different ports for listening. I used netstat utility in windows to check wh