Looking for sample code to create my own pub/sub!

I am a new bee in JMS. So I would really appreciate if
some one could give me some hint to start up with my school project. I am looking for a sample Java code that will:
For the Publisher:
1. Connect to a broker [create it, if it does not exist]
2. Create a publisher/destination.
3. Create a pub-sub queue
4. Publish a message
5. Ack or Nak depending on if the subscriber got or did not get the message.
For the Subscriber:
1. Connect to a broker [create it, if it does not exist]
2. Subscribe to the broker
3. Subscribe to the Queue
4. Show an received messages on the console.
Here are the command line params for both the Publisher and subscriber:
runPub 127.0.0.1:7676 myTestBroker myQueue "this is my message"
runSub 127.0.0.1:7676 myTestBroker myQueue
Please tell me if there are similar java code that will do all this and work with ANY JMS compatible client. i.e. I should not have to use the Admin tool of any JMS Server (MQSeries, iPlanet, SonicMQ etc etc). The code should follow the JMS spec and do this programmatically.
Thank you very very much in advance for doing this great favor.
With regards,
Amir.

Thanks a lot for that hint. I think that's a great tutorial for a beginner. I could compile those sample codes from chapter 4 with out any problem, but could not run it. I also installed j2sdkee1.3.1 and updated my classpath according to the spec. But when I tried to run the "j2ee -verbose" command it was giving me the following error message:
ERROR: Set J2EE_HOME before running this script.
Any advise for me that I should follow next. Thanks again.

Similar Messages

  • Looking for sample code using "first_tab" and "next_tab"

    Looking for sample code using "first_tab" and "next_tab". How is it used with ItemID within a dialog box? I've read the reference books - don't understand it.

    Hi Ray,
    There are several ways to do this, and in the example I created, I actually did not end up using shift registers. I've attached some example code that basically multiplies the period by the duty cycle percentage to achieve the number of milliseconds to be high and low.
    You would just need to insert your DIO code in each frame of the sequence structure.
    Hope that helps. Kind regards,
    -Sam F, DAQ Marketing Manager
    Learn about measuring temperature
    Learn how to take voltage measurements
    Learn how to measure current
    Attachments:
    70_PWM_Example.vi ‏23 KB

  • Looking for sample code of pwm output with Labview 7

    we are looking for sample code in LabView 7 for producing a pwm output. We are current using a 3rd party digital I/O board and just want to generate a pwm output on several of the bits.

    Hi Ray,
    There are several ways to do this, and in the example I created, I actually did not end up using shift registers. I've attached some example code that basically multiplies the period by the duty cycle percentage to achieve the number of milliseconds to be high and low.
    You would just need to insert your DIO code in each frame of the sequence structure.
    Hope that helps. Kind regards,
    -Sam F, DAQ Marketing Manager
    Learn about measuring temperature
    Learn how to take voltage measurements
    Learn how to measure current
    Attachments:
    70_PWM_Example.vi ‏23 KB

  • Looking for sample code of HOW-TO use EntityFacadeImpl class

    I have created the following using JDeveloper Ver 9.0.3.1:
    1. Entity Bean
    Localinterface: userLocal.java
    Local home interface: userLocalHome.java
    Remote interface: user.java
    Remote home interface: userHome.java
    Bean implementation: userBean.java
    2. Facade Session Bean (auto generated by JDeveloper)
    userFacade.xml
    userFacadeColImpl.java
    userFacadeImpl.java
    I am looking for sample client code on how to make use the facade session bean.
    Thanks in advance.

    repost

  • Looking for sample code to decrypt MYSAPSSO2 session cookie

    Hello,
    I am looking for a sample code to decrypt MYSAPSSO2 session cookie and get the username out of it.

    Hi Roy,
    if you just need the username the easiest way is to grab the Cookie and Decode it using Base64. The username is contained in cleartext.
    e.g.
    MYSAPSSO2 Ticket as fetched from Browser:
    AjExMDAgABFwb3J0YWw6bXRyaWNhcmljb4gAE2Jhc2ljYXV0aGVudGljYXRpb24BAApNVFJJQ0FSSUNPAgADMDAwAwADRDAxBAAMMjAwODA3MjUwNTA3BQAEAAAACAoACk1UUklDQVJJQ0%2F%2FAQUwggEBBgkqhkiG9w0BBwKggfMwgfACAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHATGB0DCBzQIBATAiMB0xDDAKBgNVBAMTA0QwMTENMAsGA1UECxMESjJFRQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDgwNzI1MDUwNzU5WjAjBgkqhkiG9w0BCQQxFgQUxUGK!5EDTrHQErPQCVJhEySzTBAwCQYHKoZIzjgEAwQvMC0CFQCD3K2A2hrgpNa5EceiDXjRN309ewIUTM3DJi8QTxmk%2FJez!rjnFlTM3BQ%3D
    Decoded Ticket using Base64:
    1100 uFFFD portal:mtricaricou02C6uFFFD basicauthentication uFFFD
    MTRICARICO uFFFD 000 uFFFD D01 uFFFD 200807250507 uFFFD uFFFDuFFFDuFFFD
    If you want to do it programmatically using any libraries to completely decode the ticket, check the validity and also access the certificate information inside the ticket you can use a SAP Extension called SAP SSOEXT (Goto service.sap.com/swdc and search for SSOEXT => The package also contains documentation and samples for various programming langauges such as JAVA).
    This one needs dynamic libraries or shared libraries to be linked.
    There also is a pure JAVA approach.
    Have a look at this:
    http://www.zope.org/Members/Dirk.Datzert/MySapSsoSupport/
    But:
    The approach of decrypting the cookie does not really make since when you are in a SAP system it is more intended for 3rd party systems in order to implement SSO.
    Hope this helps
    Cheers

  • Beginner looking for sample code

    Hello Mobile Developers,
    Just got my Flash Builder 4.5 two days ago. I have some Flex and Objective-C experience. I am looking for some example code
    showing me how to build a simple "ActionScript Mobile Project" for the iPad. Any links or snippets are welcome.
    Is it possible or planned to be possible, to build a native Objective-C Project in XCode and include the ActionScript/AIR features as a Library or
    Framework, so that one could mix native UIKit Views with others based on ActionScript ?
    Or is it possible to implement ActionScript wrappers around native code ?
    Regards,
    Dirk

    Hi,
    Just tried the sample with my Flash Builder 4.5 - without success. The project references a Flex SDK named "superhero". I changed that to Flex 4.5
    which is the one that came with Flash Builder.
    It seems that the project requires AIR 2.7. Which Flex SDK do I need to run this example ?
    Regards,
    Dirk

  • Looking for sample code - version control

    Do you recommend a resource where I might find sample code or opensource for basic Windows file version control? I want to be able to compare two directories (and their subdirectories) for file name, creation date, and size. Thanks.

    File size is in no way accurate to compare to files together for changes.
    You'll want something like a CRC32 checksum.
    This basically takes any sized file, and generates a "mostly random and unique"
    string of 8 hex chars. The odds two different files having the same CRC32 value are supposed to be 2 ^ 32... ie. about 4 billion to one against.
    I posted code here to generate the CRC values.
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=641367
    So you generate the CRC values for each file in the directory.
    Then, when you generate the CRC32 values the next time you visit, you can compare the previous value with the current value to detect if a single file has changed.
    regards,
    Owen

  • Restartability in code - looking for sample code

    Hi - does anyone have sample code that includes checkpoints and savepoints and has restart logic built in?

    Since there haven't been any replies here, maybe a member
    of the general database forum at:
    http://forums.oracle.com/forums/index.jsp?cat=18
    will be able to help.
    -- CJ

  • Looking for sample code of JSP consumer of  XML

    Does anyone have info. on how to send XML to a JSP? Hopefully, I can have any client (able to post to http), create the XML, then send it off to a URL which is a JSP. The JSP then parses the XML and builds html based on data from the XML.
    Thanks,
    Jay

    I'm not quite sure I understand what you mean. Do you want someone to be able to send an xml file via Http POST and have you transform that to html to display?
    Anyway, here is some code wich may be useful.
    The following is from a servlet used to transform data generated from a sql database to xml and to send the xml to a browser:
         response.setContentType("text/xml");
         PrintWriter out         = response.getWriter();
         JDBC2XML jdbc2xml   = new JDBC2XML();
         DataSource ds         = JNDIBean.lookupDataSource(request.getParameter("dsName"));
         out.println(jdbc2xml.execute(ds, request.getParameter("sql")));In the above, the JDBC2XML just generates the xml from the sql.
    The following is from a servlet which recieves xml and transforms it to html. The servlet is mapped to *.xsl and uses the xsl file requested to do the transformation.
             TransformerFactory tFactory = TransformerFactory.newInstance();
             //get the real path for xml and xsl files.
             String ctx = getServletContext().getRealPath("") + FS;
             // Get the XML input document and the stylesheet.
             Source xmlSource = new StreamSource(new StringReader(xml));
             Source xslSource = new StreamSource(new URL("file", "", qryDoc).openStream());
             // Generate the transformer.
             Transformer transformer = tFactory.newTransformer(xslSource);
             // Perform the transformation, sending the output to the response.
             transformer.transform(xmlSource, new StreamResult(out));FS in above is: System.getProperty("file.separator");
    If you simply want a jsp to display xml using a stylesheet I suggest you use JSTL - it's simple to learn and all the work has already been done for you. BTW, if you so choose, feel free to modify/re-write any of the above code to meet your needs. YMMV.

  • Looking for a Programmer to Create A YouTube "Embed" Plug In

    Hello everyone,
    I am Looking for a Programmer to Create An Acrobat Pro "Embed" Plug In based on the free YouTube API.
    The purpose of this is to be able to easily embed YouTube Video's within Acrobat documents so that It can stream the content into the PDF file.
    Many have suggested to download the content and embed it, but doing so will violate the user agreement with YouTube plus it would increase the size of the PDF file consideribly.
    If there are any Programmers out there that would be interested in taking this project on please let me know. I believe there is a real need for this tool which people would really like to have.
    The programming goals for the project would be as follows:
    1. Take the Free YouTube API and create a plug in for Acrobat that would allow you to easily embed content into any PDF.
    2. The "Embed Plug-In" Would essentially allow you to just copy and past the embed codes from YouTube, Hulu, or any other web source that provides an "Embed Code" so that the content can easily be placed within the PDF.  This embeded content could be videos, audio, playlist systems, ads, etc.. "anything with embed codes."
    3. You would be able to select an area of the PDF for the placement, paste the code and then be able to resize the content window. i.e. for YouTube Files.
    The Market for this is as follows:
    - Web Based Magazines, or Flash Magazines that were created with Indesign, Acrobat then Flash. They can easily then create interactive content, with ads and multimedia. Anyone cab be interactive publisher then, no need for Flash Programming Skills.
    - Educational Institutions that want to create lesson materials with Web Content.
    - Business's that wish to share media elements from the web within PDF presentations.
    If you need examples of how this might be used please contact me to discuss it further.
    Thanks for your assistance.
    Regards,
    Robert
    Robert Stewart
    creativemind
    New York

    Since I only found the plug in yesterday I've only played with it a little bit.
    First thoughts:
    It works.  It's easy to set up.  I followed the instructions and I had a link working to our promotional video on youtube in only a couple of minutes.
    Things I found:
    I am using layers extensively in my pdf and wanted the plug in window to show up on only one layer.  However as I mentioned before it doesn't do that so my workaround was to change the settings in the video to play in a floating window.  However the plugin window is still visible if you do this, so my workaround was to reduce it to essentially a dot on the page and hide it on something pale grey!  I created a button in InDesign and used that to fire the video.
    Security stuff:
    Obviously the pop up windows are somewhat frustrating but I see no way to get around them without doing what Joel suggested in his other blogs, which given the amount of users receiving my pdf and their varying competence levels with computers is not really an option.  My workaround for that was to include a note explaining what to expect and do when they did show up.
    For the future:
    See if Adobe would make this an option in InDesign and usable within it's layers section.  That would be awesome.  I haven't had a chance to check out the addin Joel mentioned that might help with this in Acrobat.  Have you?
    Thanks for the other tips on embeding html etc - always good to find new ways get around problems.
    Grahame

  • Looking for a Programmer to Create An Acrobat Pro "Embed" Plug In

    Hello everyone,
    I am Looking  for a Programmer to Create An Acrobat Pro "Embed" Plug In.
    The purpose of this is to be able to easily embed YouTube  Video's within Acrobat documents so that It can stream the content into  the PDF file.
    Many  have suggested to download the content and embed it, but doing so will  violate the user agreement with YouTube plus it would increase the size  of the PDF file considerably.
    If there are any Programmers out there that  would be interested in taking this project on please let me know. I  believe there is a real need for this tool which people would really  like to have.
    The  programming goals for the project would be as follows:
    1.  Take the Free YouTube API and create a plug in for Acrobat that would  allow you to easily embed content into any PDF. The content must be PC & Mac Playable within the Latest Version Reader.*
    2. The "Embed  Plug-In" Would essentially allow you to just copy and past the embed  codes from YouTube, Hulu, or any other web source that provides an  "Embed Code" so that the content can easily be placed within the PDF.   This embeded content could be videos, audio, playlist systems, ads,  etc.. "anything with embed codes."
    3. You would be able to select  an area of the PDF for the placement, paste the code and then be able see a preview of the content, then be able to  resize the content window. if it resizable like YouTube Files.
    4. You need to be able to "Add" to the defined the "Trusted Source" from the Emebed Code information so that it does not require every instance of the content loading to require the user to select "Allow" each time it loads.
    The  Market for this is as follows:
    - Web Based Magazine Creation, that turn into  Flash Magazines that were created with Indesign, Acrobat then Flash. This process  would easily allow anyone to create interactive content, with ads and  multimedia. Anyone cab be interactive publisher with no need for Flash  Programming Skills which is currently what is needed to achieve much of this process.
    - Educational Institutions that want to create  lesson materials with Web Content.
    - Business's that wish to  share media elements from the web within PDF presentations and Business Materials, such as training materials, Marketing Research, etc..
    If you need  examples of how this might be used please contact me to discuss it  further.
    I have a project that I am working on that needs this type of functionality and the deadline is approaching so I am seeking any and all help  I can find to reach my goal. This Plug could also be a plug in to Indesign as well. Whatever it will take to reach the desired goal.
    Thanks  for your assistance.
    Regards,
    Robert
    Robert Stewart
    creativemind
    New  York

    I think this is what you need.
    http://blogs.adobe.com/pdfdevjunkie/the_youtube_widget_for_acrobat.html
    Hope it helps.

  • Transaction code to learn for sample codes about trees and containers

    trnasaction code to learn for sample codes about trees and containers

    hi check this....,
    REPORT  Ztree_TEST_PGM.
    Type-pools : fibs,stree.
    data : t_node type snodetext.
    data : node_tab like t_node occurs 0 with header line.
    clear : node_tab, node_tab[].
    node_tab-type = 'T'.
    node_tab-name = 'Earth'.
    node_tab-tlevel = '01'.
    node_tab-nlength = '5'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Europe'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Germany'.
    node_tab-tlevel = '03'.
    node_tab-nlength = '7'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Berlin'.
    node_tab-tlevel = '04'.
    node_tab-nlength = '6'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Asia'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '4'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'India'.
    node_tab-tlevel = '03-'.
    node_tab-nlength = '5'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Bombay'.
    node_tab-tlevel = '04-'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
      TABLES
        NODETAB                  = node_tab .
      DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
      DATA: wa_type TYPE stree_ctl_type_mapping.
      CLEAR: type_mapping[].
        wa_type-type = 'A'.
        wa_type-icon = '@BL@'.
        APPEND wa_type TO type_mapping.
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
       USE_CONTROL                     = 'L'.
    A list of other function modules that can also be used to construct tree reports:
    SEUT,                            Hierarchy framework
    RS_TREE_ADD_NODE                 Insert nodes
    RS_TREE_AUTOMATIC_REFRESH
    RS_TREE_COMPRESS                 Hide subtree(s)
    RS_TREE_CONSTRUCT                Construct new hierarchy or insert subtree
    RS_TREE_CONTROL_PREPARE
    RS_TREE_CREATE                   Create hierarchy
    RS_TREE_DELETE_NODE              Delete node with associated sub-tree
    RS_TREE_EXPAND                   Expand subtree
    RS_TREE_GET_CURRENT_LAYOUT       Get layout information for displayed hierarchy
    RS_TREE_GET_CURRENT_NODE         Get node at which cursor is positioned
    RS_TREE_GET_CURRENT_ROOT         Get current root node
    RS_TREE_GET_CURRENT_TREE         Get structure information for displayed hierarchy
    RS_TREE_GET_INPUT                Get entires from input fields
    RS_TREE_GET_MARKED_NODES         Get selected nodes
    RS_TREE_GET_MODIFICATION_LOG     Get change log for hierarchy
    RS_TREE_GET_NODE                 Get nodes for specified ID
    RS_TREE_GET_NODE_BY_NAME         Get node for specified node name
    RS_TREE_GET_PREDECESSOR          Get preceding node
    RS_TREE_GET_SEARCHSTRING         Get last search strinng
    RS_TREE_LIST                     Simulate hierarchy or subtree display
    RS_TREE_LIST_DISPLAY             Display hierarchy
    RS_TREE_LIST_DISPLAY             Display hierarchy
    RS_TREE_MODIFY_NODE
    RS_TREE_MOVE                     Reassign node with subtree
    RS_TREE_POP                      Get hierarchy from the stack and restore
    RS_TREE_PUSH                     Place hierarchy on the stack
    RS_TREE_RESET_LOCK               Deselect node
    RS_TREE_SET_CURRENT_LAYOUT       Set layout with marked cursor position
    RS_TREE_SET_CURRENT_TREE         Set other hierarchy
    RS_TREE_SET_LOCK                 Select node
    RS_TREE_SET_NODE                 Change Nodes
    RS_TREE_SET_SCROLL_POS           Position node at the beginning of the page
    RS_TREE_SLEEP
    RS_TREE_SORT_CHILDREN
    regards,
    venkat.

  • Java.lang.instrumentation (looking for examples, code snippets)

    I'm exploring the use of java.lang.instrumentation, management for a variety of tasks such as profiling, monitoring, etc.
    I'm looking for some code snippets and examples to get me bootstrapped. Didn't find any doing a search.

    Unfortunately there aren't any examples of java.lang.instrument usage available yet. I will try to rectify this.
    java.lang.instrument.Instrumentation is an interface, but it is not an interface that users of java.lang.instrument implement. A single instance of a class, internal to the JRE, which implements this interface is created if and only if the -javaagent flag is used. This sole instance is then passed into the premain method.
    Robert G. Field
    JSR-163 Specification Lead

  • Looking for an app to create logos any suggestions

    looking for an app to create logos any suggestions

    Hi ...
    Logo Design Studio Pro. Click here >  http://itunes.apple.com/us/app/logo-design-studio-pro/id402531446?mt=12
    Then click:  View in Mac App Store
    And much less pricey Logo Lite >  http://itunes.apple.com/us/app/logo-design-studio-lite/id423652700?mt=12

  • Looking for some help in creating an ItemFilter for a Targeter

    Looking for some help in creating an ItemFilter for a Targeter
    Need a examples for creating itemfilter and TargeterFirst

    Hi David,
    We can integrate Syncfusion with LightSwitch application, if you want to customize column when create a report using syncfusion reportviewer, since I didn't try this third party
    extension before, I think you could consider getting help from
    syncfusion forum, more syncfusion experts can help you on this issue.
    Thanks for your understanding.
    Best regards,
    Angie
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Youtube not working in Safari

    Hello, this is my first post. Recently I have been experiencing a problem with running youtube videos in the Safari browser. It started to happen spontaneously about 1-2 weeks ago, and so far has not changed. If I click a video to play (embedded like

  • Restore comments in iweb

    hello, i seem to have lost all my blog comments on my .mac published site. i have a saved "domain" file with all my old comments still showing when i open it but when i try to re-publish to .mac it still shows 0 comments on all my blog entries. is th

  • Installing plug ins on Logic pro.

    I would like to know if there is a specific folder to install AU plug ins of brands other than Apple.I had no issues when I installed Native Instruments that installed itself on the default location.A few other plugins do not seem to show up in Logic

  • Edits Won't Show in Develop Panel

    I just purchased Lightroom 5.2 and am trying to edit without success.  In the Develop panel, I can see and use any of the edit adjustments/sliders on the right.  The edits are visible in the small photo in the filmstrip area at the bottom of the page

  • Blu ray burn error "please check boot volume space"

    Hi, every time I use Compressor 3.5.3 to burn a BD (on LaCie BD drive), I get the error "Finishing: could not create the DVD (Please check to see if your boot volume has sufficient space)". However, my boot harddisk has over 200 GB free space. Any su