Producer and Consumer  JMS Connections

Hello,
I am writing a JMS provider and I notice that Flex creates a
JMS connection for a Producer and another JMS connection for a
Consumer in my test application. Is this normal behavior for Flex
or do I have a problem with my provider that is causing this?
Thanks,
Chris Shafer, George Weiss Associates

If your goal is to have one JMS Consumer which receives
messages and broadcasts them to Flex clients, you can do this
without using the JMS adapter. Write some Java code either as a
"message driven bean" or using the JMS apis directly to grab the
JMS messages. You can then convert these messages to flex messages
and send them to an ActionScriptAdapter flex messaging destination.
See the Feed.java sample for the code necessary to do this. The
trickiest part of this is getting the JMS messages in the first
place. We are working on packaging up our JMS consumer apis so you
can do this more easily in a future release.

Similar Messages

  • Business Package on Producer and Consumer in a FPN

    Hi Gurus,
       I need to know if we need to install the Same Business packages on both the producer and consumer or is it enough to install the Business Package only on the producer....
    Regards!

    Whats your scenario, typically one would go about installing business packages and other content on the producer or multiple producers and federate it with a consumer portal and provide access via the consumer.
    For example if you have a box which hosts ESS content, another box which hosts BI content and you have a global portal which is the box which all the end users will be accessing, then you simly have to install BP for ESS on the ESS box, create BI content on the BI box and display all this content via the consumer (global portal).
    Hope this helps.
    Good Luck!!
    GLM

  • Producer and Consumer Issue

    Hi,
    Do we need to consume all the portles of the producer from portal admin console?
    or is there a way to use the .Portal file directly as all the portlets of the producer are consumed already?
    Edited by: user8894463 on Dec 15, 2009 2:34 PM

    Hi
    1. In 10.x (not sure about 9.x), from Workshop IDE, we can create like Standalone Books and Pages that can be Consumed as Whole on the Consumer side. From IDE, right click project and select New -> Other -> Expand Weblogic Portal and you should see "Book", "Page". Once this is done, you can add all your portlets on these stuff. Now on Consumer Side, when you register the Producer, you do See these Books and Pages. So if you consume full Book or Page, you will get all the Portlets also. This is very handy instead of creating and consuming "n" number of portlets on consumer manually. Also if your consumer portal is created from Workshop IDE, you can choose above menu option and select "Remote Book" or "Remote Page" and this asks for Remote Producer URL and consume that entire book or page. All that matters is on Producer side, you will not create Books and Pages in .portal file. Instead use the first above option like Create New Other -> Book or Page.
    2. By default, when you register Producer, it just shows list of all Portlets from Producer. It is upto you on Consumer side, what portlets to consumer or not and create corresponding proxy portlets. By default, all portlets created from WLP are Remotely consumable.
    The concept of creating standalone Books and Pages and consuming them as a whole on Consumer side is really cool.
    HTH
    Ravi Jegga
    Edited by: Ravi Jegga on Dec 15, 2009 6:25 PM

  • JMS producer and consumer as Web service?

    Q:WSI17-Does Weblogic support JMS producers and consumers as Web service? And could
    it be Topic or Queue?

    A<WSI-17> The message style web services can be producers, consumers or both. Additionally,
    both Point to Point (Queue) and Publish/Subscribe (Topic) domains are supported.
    See the documentation at http://edocs.bea.com/wls/docs61/webServices/develop.html#1031913.
    "Elie Dagher" <[email protected]> wrote:
    >
    Q:WSI17-Does Weblogic support JMS producers and consumers as Web service?
    And could
    it be Topic or Queue?

  • Drawback of putting producer and consumer in one loop. [Ethernet IP]

    The "Create Assembly Instance" exapmple vi have two separte loops. One for the input (producing data) and the other for the output (consuming data). Would it be possible to combine everything into one loop? Are there any drawbacks to using one loop for the input and the output?
    and i know one drawbacks will be that both consumer and producer will have to have the same rate.. 

    That's an interesting piece of code.  It's not so much a producer/consumer as it is two separate loops handling input and output.  Take a look at this link to see what producer/consumer is: http://www.ni.com/white-paper/3023/en/  You can also find the code by going to File->New and opening the "From Template" folder under VI.
    What controls your state machine?  With events not being possible on a RT system, I'd expect you'd have some form of polling.  Polling would still use a time period between polls.  Granted, the network requirement would definitely break determinism, as you've already noted.  If you're doing this, why not put it into a timed loop?  Timed loops aren't always determinstic.  That's why there is a "Finished Late?" terminal.  It's not the loop that makes the code deterministic, it's the way you put your program together. By moving it into a timed loop, you gain the ability to give it a priority.  I'll explain why this is important in a minute.
    You're welcome to combine the two into a single loop if you still meet your timing requirements.  That's a design choice that is up to you.  I don't know what your other Ethernet/IP "stuffs" is, but I'd likely combine this into my output loop if possible.  I'm assuming it has something to do with the data you care to send.
    The overhead from the loop isn't enough to worry about the worload on the CPU.  Ultimately, the code within the loop determines how rough you're being on the CPU.  That's true in one loop or in four loops.  Splitting code into multiple loops just lets you prioritize code.  If everything is in a single loop, it all must run before the next iteration.  If your code is split into ten loops, as an example, only what is inside each loop must be run on that loop's iteration.  Using priority, as you've mentioned, ensures you determine which loop runs first.  Let's say that loop completes and gives the other loops time to run on the CPU.  Before they complete, the loop wants to run again.  The CPU will go back to that loop and run.  By splitting the loops up, you've ensured this piece of your code will run even if the CPU can't handle processing all of the code within that period.  Rather than hurting determinism, you've aided it.  The parts of your code that you aren't worried about being deterministic happen when the CPU has time for them.  The parts that you NEED to be deterministic happen deterministically and push those other parts of the code out of the way.
    Looking at the example code you're showing, I'd really want to know what it is you plan to do with the code and what you need to be deterministic.  I'd assume you plan to read the data, process it, and send a corresponding output.  If you need ALL of this to be deterministic, I'd put it within a single loop or use queues to send data from the input loop (commented as consumer) to the output loop (commented as producer).  This decision would really just depend on how fast you care to acquire data and how deterministic you desire the output to be.  Without using the queues, you create something called "race conditions."  When you send an output, is that related to the newest input or one before it?  You simply cannot tell.  
    Jeff B.
    Applications Engineer
    National Instruments

  • Thread Producer and Consumer

    Hi
    I have an array that keeps Integer into it. what is wrong with this problem i cant fix it. Thread Consumer never start.
    Producer class: Putting nr 1 to 50 int into array eg. 1-2-3-4-5-6-7-8-9-10.....
    Consumer class : removing 50 down to nr 10 from array 50-49-48-47...
    Main Class : Threads creator and starter.
    How can i let Thread P start before C. and when P is finnish it call C, and then C when its done it wakes up P and running like that for life. HOWWW Plz help
    MAIN CLASS:
    import java.util.ArrayList;
    public class Main {
    static ArrayList<Integer> list = new ArrayList<>();
    public static void main(String[] args) {
    Thread p = new Thread(new Producer());
    Thread c = new Thread(new Consumer());
    p.start();
    c.start();
    PRODUCER CLASS:
    public class Producer extends Main implements Runnable{
    @Override
    public void run() {
    while (true) {
    // Tilføjer cornflakes til arrayListen hvis < 10
    if (list.size() <= 10) {
    for (int i = list.size(); i < 50; i++) {
    list.add(i);
    System.out.println("p : " + list.size());
    try {
    Thread.sleep(100);
    } catch (InterruptedException ex) {
    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }// end Forloop
    }// end if
    }// end while
    Consumer CLASS
    public class Consumer extends Main implements Runnable {
    @Override
    public synchronized void run() {
    while (true) {
    // Tilføjer cornflakes til arrayListen hvis < 10
    for (int i = list.size(); i > 10; i--) {
    list.remove(i);
    System.out.println("c : " + i);
    try {
    Thread.sleep(100);
    } catch (InterruptedException ex) {
    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }// end Forloop
    }// end while
    }

    That's a reason for failure in general by the way - trying to do stuff without understanding stuff. Its best avoided in the future - first learn and learn well, then code. Then when you have problem with said code, come here and ask for help. Not before that, a forum is not a personal information service or substitute teacher.

  • FPN - Producer and consumer support stack synchronication?

    We have BI portal as a producer portal to a consumer portal (corporate portal). Both are on support stack 13 at the moment. We need to apply support stack 14 to the BI portal. Do we need to apply the same support stack to the consumer portal? Is there support documentation that contains this information?
    Thanks.

    Rich,
    We were on SP13 on both CP and PP but we ffound at least one problem when we upgraded BI PP to sp14 and CP is still on SP13. I am not certain that this problem is because of SP synchronization but I do suspect. We are looking at patching CP to SP14 and see if the problem dissapears.
    Yes, as per SAP both CP and PP can be on different SPs.
    Regards,
    Kiran

  • Will the memory leak for queue when used in producer and consumer mode in DAQ to transfer different sized array.

    In the data acquisition, I use one loop to poll data from hardware, another loop to receive the data from polling loop sent by queue.
    But everytime the size of the transferred data array may not be the same, so the system may assign different array size and recycle very frequently.
    Will it cost memory leak. Or will it slow down the performance, since the array size is not fixed, so every time need to create a new sized array.
    Any suggestion or better method. 
    Solved!
    Go to Solution.

    As i understand your description, your DAQ-loop acquires data with the setting '-1' for samples to read at the DAQmx read function. This results in the different array sizes.
    Passing those arrays directly to a queue is valid and it does not have significant drawback in performance (at least as far as i know) and it definetly does not leak memory.
    So the question is more or less:
    Is it valid that your consumer receives different array sizes for analysis? How does your consumer handle those arrays? 
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • BOM that needs to produce and consume same component

    If I have a process in which I am mixing powders in a closed system with dust control (large vacuum) what would you recommend for the following scenario?
    As I make the final blended powder, I am salting back in a variable amount of powder which has been "reclaimed" from the dust collection system.  While I am salting back in this reclaim, I will also be collecting more powder into the reclaim system, which will also get "salted" back into the process.
    In order to handle ordering additional raw materials (the base powders), I need to recognize the fact that a portion of the raw materials will be collected into the dust collector to become reclaim, but I am also USING previously collected reclaim.
    Can you structure a BOM like so?
    Alt BOM 01:
    ComponentMaterial  A         272.5 KG
    ComponentMaterial  B          272.5 KG
    ComponentMaterial  C          272.5 KG
    ComponentMaterial  D         272.5 KG
    ComponentMaterial  E          -90      KG
    ComponentMaterial  E          125      KG
    Alt BOM 02:
    ComponentMaterial  A         272.5 KG
    ComponentMaterial  B          272.5 KG
    ComponentMaterial  C          272.5 KG
    ComponentMaterial  D         272.5 KG
    ComponentMaterial  E          -90      KG
    ComponentMaterial  E          55        KG
    Does that make sense?

    yes this makes sense. it should work.

  • Consume JMS Unit-Of-Work message through OSB proxy service

    Hi,
    Anyone know how to consume a JMS Unit-Of-Work (UOW) message using an OSB Proxy Service of JMS type?
    I can submit a unit-of-work JMS message (which consists of multiple constituent messages) using an OSB proxy & business service combination and setting the UOW transport headers appropriately. I can also separately produce and consume Java objects via a JMS queue where the consumption is done via OSB proxy (of java request message type), but these aren't UOW messages.
    Apparently as soon as it is a UOW message then the message consumed is an ObjectMessage ArrayList and one has to use the "Java" request message type for the JMS consumer proxy, but I'm unsure of how to create the concurrent client jar to use it in the same proxy service's JMS transport configuration in order to output the ObjectMessage ArrayList (UOW message). 
    Ideally I'd like to consume a single UOW XML message via an OSB JMS proxy service.
    Any pointers would be appreciated.
    R

    Finally got this working!!
    For posterity: Needed to insert Java Object JMS messages on the OSB JMS producer (Business Service) side with correct UOW jms transport header set in route node. Then consume the Unit-Of-Work message on the other side via jms proxy service with "java" request message type, with appropriate jar containing the Object class as the "Client jar" in the JMS Transport configuration. In the same JMS consumer proxy I had to do a java callout, passing the contents of $body, using java.util.ArrayList and javax.jms.ObjectMessage, as input into a method (.. decodeJavaMessage(ArrayList<ObjectMessage> ...)). In this java callout class you can get to each individual ObjectMessage via typecasting the get() method on the Arraylist to (ObjectMessage) and then just typecast the getObject() on this Objectmessage into your original Java Class (same as what you inserted onto queue originally).
    Hope this saves someone some time in future!

  • How Long Can I cache JMS Connection ?

    Hi
    My servlets need to send messages to queues. For speed, I am creating and caching JMS connection and queue session in the servlet's init() method. The questions are
    1) Will the queue session or connection time out after a couple of days , assumimg the servlet never gets unloaded/reloaded in that period?
    2)Is there a way to figure out a connection /session status before trying to create a sender and catching exceptions ?
    Regards
    -m

    Hi,
    The connections do expire after few days hence the easiest way would be to have a double check ....ie.. as you are caching the connection and when ure trying to create a session from the connection keep a try-catch to determine if the connection has expired and if yes then you can create a new connection and cache it again. Now you can use this cached connection to create the sessions .
    Hope this helps
    neo

  • Send data from producer to consumer

    Hi,
    I am trying on a sampe project with weblogic as both producer and consumer. I could send the data from consumer to producer to using Interceptors. Now, my requirement is to send data from producer back to consumer. I can do this using SimpleStateHolder, but I want a generic way like passing information in cookies/HTTP Request Headers from producer...etc and to retrieve them at consumer. This is because in my actual implementation the producer will be websphere.
    So, please can anyone tell me how to send data from producer to consumer ???
    Thanks,
    Anu

    Hello Anu,
    I believe WLP 10.2 requires some patches to get the consumer
    interceptor to properly access cookies coming from the producer, so
    that is probably why you aren't seeing the cookies. After reading your
    use-case, I don't think you will need to get these patches to get your
    use-case to work, but if you are still interested in the patches, I can
    find out the details for you.
    The reason the redirect code you posted isn't working is because the
    response has already been committed during the getMarkup operations and
    it is too late to redirect the page to a different URL, so the redirect
    is being ignored.
    The good news is that the functionality you want should all be fairly simple to implement.
    When the user opens the remote portlet, makes a selection and then
    submits it, the first thing that will happen is a WSRP
    BlockingInteraction call to the producer, to let the remote portlet
    know that a user has interacted with it. This happens before the
    GetMarkup operation, during a time when it is still legal to redirect
    to a different URL. In fact, the portlet on the producer is allowed to
    send a response indicating that the page should be redirected to a
    different URL.
    So in your remote portlet, you can have it look at the form values that
    were submitted during the BlockingInteraction call, and if the user
    selected the particular value that should be redirected to another
    portlet, the remote portlet can request a redirect. The only problem
    here is that your remote portlet doesn't know the URL to the portlet it
    wants to redirect to on the consumer side, but you can handle that in
    an interceptor on the consumer.
    So, rather than implement the IGerMarkupInterceptor, use the IBlockingInteractionInterceptor. For example:
    public sampleInterceptor implements IBlockingInteractionInterceptor
    // Other methods need to be implemented to do nothing...
    public Status.PostInvoke postInvoke(<code>IBlockingInteractionRequestContext requestContext,
    IBlockingInteractionResponseContext responseContext)</code>
    String redirectUrl = responseContext.getRedirectURL();
    if(redirectUrl != null)
    // The producer portlet wants to redirect- substitute the right consumer URL
    PageURL pageUrl =
    PageURL.createPageURL(requestContext.getHttpServletRequest(),
    requestContext.getHttpServletResponse),
    "voipTrunk_portal_page_11_page_12_page_13");
    responseContext.setRedirectURL(pageUrl.toString());
    This should be all that you need to do on the consumer side. It will
    automatically redirect for you to the URL you set in the interceptor,
    since the producer portlet requested a redirect.
    On the producer side, you will need to have the portlet send the
    redirect request during the BlockingInteraction operation. How you do
    this depends on what portlet type you are using and what producer you
    are using. For example, in WLP using a JSP portlet, you would need to
    use a backing file on the portlet, and have that class implement the
    JspBacking class:
    http://edocs.beasys.com/wlp/docs102/javadoc/com/bea/netuix/servlets/controls/content/backing/JspBacking.html
    Then, in the handlePostbackData method you would look for the special value and redirect if it exists, such as:
    public boolean handlePostbackData(HttpServletRequest request, HttpServletResponse response)
    String paramValue = request.getParameter("paramName");
    if((paramValue != null) && (paramValue.equals("specialValue"))
    // Need to send a redirect request
    PortletBackingContext pbc = PortletBackingContext.getPortletBackingContext(request);
    pbc.sendRedirect("http://anyUrlWillWork");
    return(true);
    return(false);
    Since the consumer interceptor is changing the redirect URL, any
    redirect URL the producer sends will work- it just needs to look like a
    valid, absolute URL to pass some simple checks on the producer.
    Backing files are documented here: http://e-docs.bea.com/wlp/docs102/portlets/building.html#wp1077130
    As I mentioned before, different portlet types and producers would do
    this differently. For example, I don't think WebSphere has backing
    files, and in JSR168 portlets a backing file is not needed- you would
    do the equivalent code in the JSR168 portlet's processAction() method
    (using javax.portlet.ActionResponse.sendRedirect(String URL) to send
    the redirect request). JSR168 portlets should work in both WLP and
    WebSphere, but I don't know the details of the portlet type you want to
    use on the WebSphere producer; if it isn't a JSR168 portlet, WebSphere
    must have some way equivalent to the backing file's handlePostbackData
    method to participate in a WSRP BlockingInteraction operation and
    request a redirect.
    No cookies or headers are required though, so I don't think you would
    need the patches to WLP 10.2 for the interceptor dealing with cookies.
    Hope this helps,
    Kevin

  • Problem with transacted JMS connection factory and transaction timeouts

              We encountered an interesting problem using transacted JMS connection factories.
              An EJB starts a container managed transaction and tries to validate a credit card
              before creating some information to a database for the user, in case of success
              an SMS is sent to the user via the transacted JMS queue. If the credit card authentications
              duration is about the same as the transactions timeout (in this case the default
              30 seconds) sometimes the database inserts is committed but the JMS insert is
              rollbacked. How can this be?
              If the authorization duration is much longer than 30 seconds everything works
              fine (both database and JMS inserts rollbacked), the same is true if a rollback
              is insured by calling EJBContext.setRollbackOnly(). The problem thus occurs only
              if the duration is approximately the same as the transaction timeout, it appears
              that the database insert is not timeouted but the JMS insert is. How can this
              be if they are both participating in the same transaction.
              The JMSConnectionFactory used is a Connection factory with XA-enabled. The result
              is the same also with the default "javax.jms.QueueConnectionFactory" and if we
              configure our own factory with user transactions enabled.
              Any help appreciated!
              

    Tomas Granö wrote:
              > We encountered an interesting problem using transacted JMS connection factories.
              > An EJB starts a container managed transaction and tries to validate a credit card
              > before creating some information to a database for the user, in case of success
              > an SMS is sent to the user via the transacted JMS queue. If the credit card authentications
              > duration is about the same as the transactions timeout (in this case the default
              > 30 seconds) sometimes the database inserts is committed but the JMS insert is
              > rollbacked. How can this be?
              It should not be.
              >
              > If the authorization duration is much longer than 30 seconds everything works
              > fine (both database and JMS inserts rollbacked), the same is true if a rollback
              > is insured by calling EJBContext.setRollbackOnly(). The problem thus occurs only
              > if the duration is approximately the same as the transaction timeout, it appears
              > that the database insert is not timeouted but the JMS insert is. How can this
              > be if they are both participating in the same transaction.
              >
              > The JMSConnectionFactory used is a Connection factory with XA-enabled. The result
              > is the same also with the default "javax.jms.QueueConnectionFactory" and if we
              > configure our own factory with user transactions enabled.
              >
              > Any help appreciated!
              Make sure that your session is not "transacted". In other words,
              the first parameter to createSession() must be false. There is an
              unfortunate name re-use here. If a session is "transacted", it
              maintains an independent "inner transaction" independent of the
              outer transaction. From the above description, it seems unlikely
              that your application has this wrong, as you say that
              "setRollbackOnly" works - but please check anyway.
              Make sure that you are using a true XA capable driver and database
              (XA "emulation" may not suffice)
              Beyond the above, I do not see what can be going wrong. You
              may want to try posting to the transactions and jdbc newsgroups. Note
              that JMS is appears to be exhibiting the correct behavior, but the
              JDBC operation is not. The JDBC operation appears to have
              its timeout independent of the transaction monitor's timeout.
              Tom
              

  • Can Apple TV produce sound output on a wireless speaker and a cable-connected speaker simultaneously?

    My situation is this: 
    I have a one bedroom apartment.  In the main room, I have a Bose Soundlink (via bluetooth, which may be my first problem!!!).  I just got an Apple TV (3) and want to connect it to the TV in my bedroom.  I was considering getting some not-too-expensive speakers to improve upon my TV sound.  One goal of this would be to be able to access my iTunes music and play the same thing in both rooms. 
    I gather that Apple TV is no good at hosting two or more wireless speaker signals, but I'm hopeful it can manage a wireless and a direct cable input??? Does the TV need to be on to facilitate this or can it just go directly through the Apple TV?  And what use, if any, woudl the optical audio output do for me in this situation?
    Thanks for any and all answers!

    Paul
    You said the Optical to the home theatre doesn't work, do you mean it had the same sound issue or that the OA to Home Theatre didn't produce any sound?  If the latter then first check the cable is working (red light on the tip once the other end is in the ATV).
    Sorry I am not addressing the main question of poor sound as others will know that better, but the OA issue might be solvable and improve your listening, unless of course you have rented The Artist

  • JMS Adapter (for DI) does not allow passing username and password to JMS connection

    Post Author: PLed76
    CA Forum: Data Integration
    JMS Adapter (for DI) does not allow passing username and password to JMS connection. It has those fields only for MSMQ. Our Production environment does not allow us to connect to JMS (we use Tibco EMS) anonymously, so it prevents us from use of Data Integrator. Is there any way to pass those params, or obtain the correct version of JMS Adapter, or obtain source codes of the JMS Adapter so we can correct them ourselves (we can send you the corrected sources back) ? Thanks in advance for any help. (PL)ed76 Renaissance Capital

    Bump - Were having the same issue.
    Has anyone found a way to connect to Tibco with a user/pwd?
    Version 14.0.297.

Maybe you are looking for

  • How can I copy files from my shuffle to my computer

    Hi, I re-installed my computer and now after re-installing itunes it wants to synchronise my shuffle to the libery. The files on my shuffle will be lost it says. How can I copy my files before synchronising? Please help me! Cheers! Sander

  • Change color of visited link

    Hello, I would like to change the color of visited column link in my report. After user clicks on it, it opens some info region, but user wants to know what info was already accessed after this region is closed, so link should stay colored. I

  • Unable to Install New version of iTunes due to Bonjour.

    Okay, I was trying to install the new version of iTunes for my ipod nano w/camera i just bought. While i was downloading, i had to download a newer version of Bonjour. When i tried to it said " Older version of Bonjour cannot be removed." I have hear

  • My question concerns the ipad monthly calendar view.

    My question concerns the ipad monthly calendar view.  An all day event spans two days in the monthly calendar view.  Is this a bug?

  • My Ipod Shuffle 3rd Gen appears in Windows but not in Itunes

    It all Started going wrong when i converted all my music to AAC versions and deleted the old versions so it would work in my car. Since then it won't connect to Itunes but shows up in WIndows. It has taken all of my music off but still charges. ...He