How can MDB send back a feedback to the client?

Hi colleagues, I have made a client which sends a text message to a MDB. Before sending, I have created a queue for replay messages and I have this piece of code:
               txtMsg.setJMSReplyTo(replyQueue);
               msgID = txtMsg.getJMSMessageID();
               qReceiver = qs.createReceiver(replyQueue);
               qSender.send(txtMsg);
               qc.start();
               receivedMsg = (TextMessage) qReceiver.receive();
So the question is, how to send back from the MDB to the client a message if I already have this code in the MDB:
String msgID = msg.getJMSMessageID();
               Destination destination = msg.getJMSDestination();
               String txtMsg = ((TextMessage)msg).getText();
               String sender = (String) ((TextMessage)msg).getObjectProperty("JMSSender");
I wanna send back for example, the messages' ID.
thanks in advance!

I thought MDBs did not have clients.An MDB can have pretty much whatever it wants :). Its a very common requirement for an MDB to talk to a database, talk to an EJB or send new messages to some destination or combinations of all of those things.
James
http://logicblaze.com/

Similar Messages

  • How can I send an XML request to the server using servlets

    How can I send an XML request to the server using servlets

    http://forum.java.sun.com/thread.jspa?threadID=5158333
    http://forum.java.sun.com/thread.jspa?threadID=5158705
    Crossposting is lame.

  • My friend has an iPhone but doesn't use iMessage. How can I send her regular texts with the new iOS 7 update?

    My friend has an iPhone but doesn't use iMessage. How can I send her regular texts with the new iOS 7 update?

    That's because her phone is recognized in the Apple database as an iPhone.  It should eventually convert to SMS but that's above my level of expertise here so hopefully someone else can come along and help you further.  She could just turn on iMessage and solve the problem. Ha!
    Good luck!

  • How can i lookup a session bean from the client side

    how can i lookup a session bean from the client side...........i am using sun appserver..............
    this is my code.................[B]
    private final static String JNDI_NAME="ejb/LmsBean";
    private static String url="ldap://localhost:4848";
    Hashtable h=new Hashtable();
    h.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
    h.put(Context.PROVIDER_URL,url);
    System.out.println("Before Loading Context in Delegate");
    Context ctx=new InitialContext(h);
    System.out.println("Loaded Context in Delegate");
    Object obj=ctx.lookup(JNDI_NAME);
    System.out.println("Loaded Object in Delegate");
    System.out.println("Before Loading Home in Delegate");
    LmsHome home = (LmsHome )PortableRemoteObject.narrow(obj,com.parx.lms.controller.LmsHome.class);
    System.out.println("Loaded Home in Delegate");
    lms = home.create();
    System.out.println("Loaded remote in Delegate");
    [B]and i got the exception........
    Inside Client before calling delegate
    Before Loading Context in Delegate
    javax.naming.CommunicationException: Request: 1 cancelled
    javax.naming.CommunicationException: Request: 1 cancelled
    at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:60)
    at com.sun.jndi.ldap.Connection.readReply(Connection.java:405)
    at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:340)
    at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:171)
    at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2640)
    at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:290)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
    at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193
    at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.ja
    va:136)
    at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.jav
    a:66)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    62)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    at com.parx.lms.lmsdelegate.LmsDelegate.getController(LmsDelegate.java:3
    0)
    at com.parx.lms.lmsdelegate.LmsDelegate.addUserDelegate(LmsDelegate.java
    :50)
    at com.parx.lms.client.consoleClient.Client.main(Unknown Source)
    pls go tru the exception and pls help.........

    That url string should be having the server name or ip instead of localhost.

  • How can i send my existing contacts on the iPhone to iCloud? it only send new ones.., how can i send my existing contacts on the iPhone to iCloud? it only send new ones..

    How can I send my exisiting contacts to icloud. It is only backing up new contacts

    Welcome to the Apple Community.
    It sounds like those contacts may be in another account on your phone. I believe you can only move them to the iCloud account on a mac/PC.

  • How can I get back my sliders in the Lightroom Library Module?

    I would be really grateful if someone could please explain how can I get back the exposure sliders on the Library panel? I don't like using the stepwise adjustments. I know that the sliders are available on the Develop panel but one of my friends has Lightroom CC & can use the old slider system. Unfortunately I can't find any information as to how to adjust the settings back to sliders.
    I am using the latest updated version of Lightroom CC on a Mac.
    This may seem a minor issue but it is driving me crazy!
    Newbie here (as far as forums are concerned)
    Thanks in advance...
    Martina

    Exposure is not available as a slider in Library.
    You can gain finer granularity on Exposure and other controls in the Quick Develop panel with the [Shift] Key.

  • In ActionScript 2.0 , How can I send HTTP request and get the response in JSON format.

    I am using ActionScript 2.0 for my app development. I have checked XML and LoadVars class. These classes by default send/receive data either in XML or name/value pair format. I want to send data in JSON format and receive the response in JSON format. How can I achieve this behavior using AS2.0. I have noticed that AS3.0 has the capabilities to do so. My client platform doesn't support AS3.0. Can anybody suggest a way to achieve this?
    Thanks in Advance.

    Atlast I am able to find the solution for this problem. In the end solutioin is very simple.
    Following steps will help in sending request in JSON format.
    1. extend LoadVars class
    2. override toString method. (It should return JSON format )
    3. Use subclass to send the request.

  • My keyboard keeps popping up in the middle of my screen instead of the bottom u keyboard keeps popping up in the middle of my screen instead of the bottom.  How can I get back to appear at the bottom of my screen?

    My keyboard keeps popping up in he middle of my screen instead of at the bottom.  How can I fix this?

    Press and hold the 'keyboard' key at the bottom right of the keyboard and after a second or so you should get a popup - slide your finger up to 'Dock' on that popup and remove your finger from the screen and the keyboard should move back to the bottom of the screen.
    You can also turn off the ability to undock and split the keyboard into two halves via Settings > General > Keyboard > Split Keyboard 'off'

  • How can I send an image directly from the browser as an attachment, not a link?

    I'm wondering if there's a way-- either via some kind of add-on or a direct FF customization-- to send an image as an attachment rather than as a link? either right-clicking an image and selecting "send image" or dragging an image into a "new message" window in outlook for example merely adds a link to the image and I'd rather that the image itself was added as an attachment. this functionality is available in IE as "email picture," which is extremely useful.
    thanks for any insight here.

    It was not mentioned what the client is. If it is a browser, the image can be sent using hml img tag. If it is using streams, then u need to set content type to image/gif or image/jpg ( depending the image u r sending) using response obj.
    response.setContentType("image/gif");
    Bye...

  • How can I send a word document as the body of email

    I have documents that are based on Word Templates that I wish to send to clients. The documents require a reply with input in a table that needs completed by the client.
    I understand there is a way to make the Word document in effect become the email and sent through TB.
    Can someone explain what I need to do i.e. settings in Word and TB.
    I don't want to send the documents either as pdf or attachment.

    I have documents that are based on Word Templates that I wish to send to clients. The documents require a reply with input in a table that needs completed by the client.
    I understand there is a way to make the Word document in effect become the email and sent through TB.
    Can someone explain what I need to do i.e. settings in Word and TB.
    I don't want to send the documents either as pdf or attachment.

  • I accidentally imported and deleted my pictures and videos to my iphone. How can i send back my pictures and videos that i accidentally imported? please reply thanks

    my iphone has no sim so that i cant connect to the internet.

    Import them just like you would any other photos, via iTunes.
    You have to connect to iTunes, and sync via the photos tab.
    This will create a new album, so it won't add ot the camera roll but be in the photos app.
    Without a sim card you can still connect to wifi, so you do have internet access if you can get wifi accesss.

  • How can I send an XML request to the server using JSP

    Can anybody say how to send a xml request
    For ex:
    Address:__________
    City: ________
    State:__________
    Country:________
    and a Submit Button.
    By clicking on the Submit Button -- xml request had to go to the server.
    Please send the detailed code for it

    xml http request..is that wat your are looking for?

  • I set up new phone (5) as a "new phone instead of backing up from icloud. How can I get back in to use the icloud backup? If I hit "delete account" does that just clear the new phone or does it get rid of my whole icloud account.

    In the set-up process I clicked "set up as new phone" when I should have clicked "back up from icloud". I can't use itunes for the back up as it is not current. Is there a way to get back into setup? If I click "delete accout" in icloud management will it clear just my phone (so I can start over) or will it actually delete my icloud?

    Settings>General, scroll to bottom of screen and tap Reset, choose to delete all data.  Then attach to itunes and choose to perform a restore.  You'll get the option to restore from icloud.

  • How can I go back to Firefox 5, the 6 update is terrible, constantly get 'not responding' when navigating.

    I want to know if I can go back to Firefox vs 5 until vs 7 comes out? I am constantly getting 'not responding' from the browser when navigating through tabs and sites. (ie. if on say facebook, after maybe writing a comment or viewing a picture, I'll click on a second picture or other comment and I have to wait for the browser to 'respond'. This happens on multiple sites and multiple tabs.
    I thought it was my internet connection at first but after trying Chrome and explorer browsers I do not have this issue.
    It is really irritating and annoying. I did not have this issue with vs 5.

    Have you tried the steps at [http://www.roboform.com/support/faq/roboform-v7#faq_firefox http://www.roboform.com/support/faq/roboform-v7#faq_firefox] ?
    Firefox 5 is not recommended for security reasons, but if you don't want 6.0 you can try 3.6.x: [http://www.mozilla.org/en-US/firefox/all-older.html]

  • How can 1 send a mail in which the content is an image file,  by JavaMail?

    I want to send a mail which has content of a gif file. I don't want an attachment. It seems that the content type "image/gif" is not supported.
    Many thanks

    u can do the following
    the solution is on implementing the DataSource class and overwrite getInputStream method
    see the following code:
    public static void setGifContent(Message msg) throws MessagingException {
    FileInputStream s;
              try {
                   s = new FileInputStream("c:\\try.gif");
              byte b[];
                   b = new byte[s.available()];
              s.read(b);
              System.out.println("byte size"+b.length);
              String x=new String(b);
              ByteArrayInputStream b1=new ByteArrayInputStream(b);
    // gif DataSource is an inner class
    msg.setDataHandler(new DataHandler(new GIFDataSource(b)));
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
    static class GIFDataSource implements DataSource {
    private byte b[];
    public GIFDataSource(byte[] stream) {
    this.b=stream;
    // Return image stream in an InputStream.
    // A new stream must be returned each time.
    public InputStream getInputStream() throws IOException {
    if (html == null) throw new IOException("Null HTML");
    ByteArrayInputStream b1=new ByteArrayInputStream(b);
    return b1;
    public OutputStream getOutputStream() throws IOException {
    throw new IOException("This DataHandler cannot write HTML");
    public String getContentType() {
    return "image/gif";
    public String getName() {
    Message was edited by:
    [email protected]

Maybe you are looking for

  • SURLError 1005? What's That All About?

    Howdy folks, fairly new mac user here. Everything's been just dandy for the last month but tonight Safari took a few attempts to get going: giving me this error code of 1005. After I finally got it running it seems slower than normal and I'm having a

  • JDBC receiver error No response available

    Hi All, I am getting below error in Proxy to JDBC synchronous scenario. This interface is to select the records based on between two dates. when number of records comes above 20000, it is failing with below error in sxmb_moni. i am getting this error

  • Undo History

    In AA 1.5 in the Edit view when the mouse was hovered over the Undo/Redo buttons a pop up told you what you were about to undo. Please can we at least have th.is function back. Even better would be a full undo history for both Multitrak and Edit view

  • When reorder item's position, arabic labels changes into ??

    Hi there, I hope u can help me with this issue: After re-ordering the positions of items (texts or check boxes) the Arabic labels of them changed into question marks, who possibly can I prevent this to happen!!, so that each time I reorder items with

  • BLOB causing FRM-40505

    Any clue why a blob field in a datablock would cause an FRM-40505 (query failed). This only happens only after I upload to the server (Forms Servlet and 9iDB). Works fine in the developer (client/server mode). HELP!