Using Java to Send Message to BlazeDS

Hello all, maybe you can help me with my problem.
I've created a very simple java program that should have no problem sending a message to BlazeDS.
Java App Code
import   flex.messaging.MessageBroker;
import   flex.messaging.messages.AsyncMessage;
import   flex.messaging.util.UUIDUtils;
public   class BlazeDSTest
    public static void main(String[] args) 
          MessageBroker msgBroker = MessageBroker.getMessageBroker(
null);
          String clientID = UUIDUtils.createUUID();
           AsyncMessage msg = new AsyncMessage();
          msg.setDestination(
"chat");
          msg.setClientId(clientID);
          msg.setMessageId(UUIDUtils.createUUID());
          msg.setTimestamp(System.currentTimeMillis());
          msg.setBody(1);
          msgBroker.routeMessageToService(msg,
null);
ok, pretty simple.  Now i'm getting a null pointer exception error when i try to run the routeMessageToService function.
Either i don't have my config,services xml set right or what, i have no idea why it can't find the message channel "chat".
I know it's in there.  I see it under the BlazeDS samples.  Is there something i need to set to specifically target a certain "folder" in blaze ds?
I want this java program to just run on the server (that blazeDS is installed on), anywhere in the os.
So like this....
JavaApp Runs -> JavaApp gets message from outside source -> JavaApp sends messages to BlazeDS -> Clients subscribed to Blaze get message
Pretty easy...but i'm beating my head.  Anyone please?
Thanks!
-kevin

Hi
With the new 4.6 version of Adobe Data Services, you can also create Java (desktop/Android) and JS/ObjectiveC applications that can communicate with a messaging destination.
http://help.adobe.com/en_US/dataservicesjee/4.6/Developing/WS4976f0ec3ef48246-681f784e12dc 3e803c6-8000.html
Regards,
Ashish Vashisht

Similar Messages

  • TS3376 Can nowaday we can use playnsound or send message on find my iphone ? I use it before but now I can't find the bottom..

    Can nowaday we can use playnsound or send message on find my iphone ? I use it before but now I can't find the bottom.. So i want to ask that did it still have or can use? If yes how to use ?

    Yes.  See http://help.apple.com/icloud/#mmfc0f19b5.

  • Using DDE to send messages to mirc

    has anyone tried using labview to send msgs to an irc channel??? if so i would lie to know more.

    Hello Tomsch1,
    Thank you for contacting National Instruments.
    You can you use DDE to send messages to mirc if mirc supports activeX. Below is a link to an example VI using DDE to write to an Excel file. You can use this as a starting point and replace the Excel calls and commands with those appropriate for mirc.
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CB9F2111EE034080020E74861&p_node=DZ52049
    I hope this helps,
    Sean C.
    Applications Engineer
    National Instruments

  • How to use java to send emails

    Hi,
    I am having problems trying to send an email using java. No idea what is going on because it looks fine. Can anyone give any insight?
    Cheers
    Robert
    import java.awt.event.*;
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    * JEmail.java
    * @author Robert Venning 18/09/2005
    * @version 1.0
    public class JEmail extends JFrame implements ActionListener{
         private static final long serialVersionUID = 1L;
         final int SMTP_PORT = 25;
         JLabel fromLabel = new JLabel("From: ");
         JLabel toLabel = new JLabel("To: ");
         JLabel ccLabel = new JLabel("CC: ");
         JLabel subjectLabel = new JLabel("Subject: ");
         JTextField from = new JTextField(20);
         JTextField to = new JTextField(20);
         JTextField cc = new JTextField(20);
         JTextField subject = new JTextField(20);
         JTextArea message = new JTextArea(10,30);
         JScrollPane scrollPane = new JScrollPane(message);
         JButton send = new JButton("Send");
         public JEmail(){
              super("Email Program");
              JPanel mainPane = new JPanel();
              JPanel pane = new JPanel();
              JPanel fromPane = new JPanel();
              JPanel toPane = new JPanel();
              JPanel ccPane = new JPanel();
              JPanel subjectPane = new JPanel();
              mainPane.setLayout(new FlowLayout());
              pane.setLayout(new GridLayout(4,1));
              fromPane.add(fromLabel);
              fromPane.add(from);
              toPane.add(toLabel);
              toPane.add(to);
              ccPane.add(ccLabel);
              ccPane.add(cc);
              subjectPane.add(subjectLabel);
              subjectPane.add(subject);
              pane.add(fromPane);
              pane.add(toPane);
              pane.add(ccPane);
              pane.add(subjectPane);
              mainPane.add(pane);
              mainPane.add(scrollPane);
              mainPane.add(send);
              setContentPane(mainPane);
              send.addActionListener(this);
         public static void main(String[] args) {
              JFrame aFrame = new JEmail();
              aFrame.setSize(350, 400);
              aFrame.setVisible(true);
         public void actionPerformed(ActionEvent event){
              try{
                   PrintWriter writer = new PrintWriter(new FileWriter("log.txt"));
                   String input, output;
                   Socket s = new Socket("mail.tpg.com.au", SMTP_PORT);
                   BufferedReader in = new BufferedReader
                        (new InputStreamReader(s.getInputStream()));
                   BufferedWriter out = new BufferedWriter
              (new OutputStreamWriter(s.getOutputStream()));
                   output = "HELO theWorld" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
         //          writer.println(input);
                   output = "MAIL FROM: <" + from.getText() + ">" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
         //          writer.println(input);
                   output = "RCPT TO: <" + to.getText() + ">" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
              //     writer.println(input);
                   output = "DATA" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
              //     writer.println(input);
                   output = "Subject: " + subject.getText() + "\n";
                   out.write(output);
                   out.flush();
              System.out.print(output);
              writer.println(output);
              output = "From: Robert Venning <" + from.getText() + ">" + "\n";
                   out.write(output);
                   out.flush();
              System.out.print(output);
              writer.println(output);
                   // message body
              output = message.getText() + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   output = ".\n";
                   out.write(output);
                   out.flush();
                   System.out.println(output);
                   writer.println(output);
                   output = "QUIT" + "\n";
                   out.write(output);
                   out.flush();
                   System.out.print(output);
                   writer.println(output);
                   input = in.readLine();
                   System.out.println(input);
         //          writer.println(input);
                   writer.close();
                   s.close();
              catch(Exception exception){
                   exception.printStackTrace();
    }

    Hi, floppit. For sending emails, I used the JavaMail API. Here is some code I wrote where I used JavaMail. The most relevant lines are in bold.
    /*   File:  ListenNotifier.java
    * Author:  Fabricio Machado
    *          [email protected]
    * This utility is based on the "Listen.java" tool from the Tiny OS
    * java tools package, in /tinyos-1.x/tools/java/net/tinyos/tools/.
    * The original application has been extended to convert raw packet data into
    * a more meaningful representation of actual photo sensor readings in
    * lux.
    * The application checks the readings against a user-defined
    * threshold, and sends email notifications when readings break the
    * threshold, and also when readings dip back below the threshold.
    * Currently, the code is only fit to handle packets from the Tiny OS
    * nesc application OscilloscopeRF.nc.  The code gets the packet data
    * by connecting via TCP to a Tiny OS java tool called "Serial Forwarder."
    * "Serial Forwarder" takes packets from the base station, and forwards
    * them to TCP port 9001.
    * Below is UC Berkeley's copyright disclaimer regarding the original code.
    *                              |   |
    *                              |   |
    *                              |   |
    *                              |   |
    *                            __|   |__
    *                                v
    * "Copyright (c) 2000-2003 The Regents of the University  of California. 
    * All rights reserved.
    * Permission to use, copy, modify, and distribute this software and its
    * documentation for any purpose, without fee, and without written agreement is
    * hereby granted, provided that the above copyright notice, the following
    * two paragraphs and the author appear in all copies of this software.
    * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
    * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
    * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
    * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
    * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
    * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
    * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
    * Copyright (c) 2002-2003 Intel Corporation
    * All rights reserved.
    * This file is distributed under the terms in the attached INTEL-LICENSE    
    * file. If you do not find these files, copies can be found by writing to
    * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
    * 94704.  Attention:  Intel License Inquiry.
    import java.util.Properties;
    import java.io.*;
    import java.net.*;
    import net.tinyos.packet.*;
    import net.tinyos.util.*;
    import net.tinyos.message.*;
    import javax.mail.internet.*;
    import javax.mail.*;
    import java.util.*;
    public class ListenNotifier{
        public static void main(String args[]) throws IOException, MessagingException {
         int i;
         int j = 0;
         Integer threshold=0;
         String to="";
         String timeStamp;
         // Check to see if user is running the program correctly.
         // If -T option is not used, a default value of 250 lux is
            // set as threshold . . .
         switch (args.length){
         case 0:
               System.err.println("usage: java ListenNotifier < EmailAddress1 > <  EmailAddress2 > . . .  -T < Threshold >\n");
               System.exit(2);
               break;
         case 1:
             to = args[j];
             threshold = 250;
             break;
         default:
             if (args[args.length-2].equals("-T")){
              threshold = threshold.valueOf(args[args.length-1]);
              to = args[0];
              while(!args[j+1].equals("-T")){
                  to = to + " " + args[j+1];
                  j++;
              break;
             else{
              j = 0;
              threshold = 250;
              to = args[j];
              while((j + 1) < args.length){
                  to = to + " " + args[j+1];
                  j++;
              System.out.printf("Mailing list is: %s\n", to);
              break;
         // Connect to the Serial Forwarder on TCP port 9001 . . .
             PacketSource reader = BuildSource.makeSF("192.168.0.12",9001);
         // Check to see if connection to Serial Forwarder successful . . .
         if (reader == null) {
             System.err.println("Invalid packet source (check your MOTECOM environment variable)");
             System.exit(2);
         try {
             // Use JavaMail API methods to set up an
             // email session . . .
          Properties props = System.getProperties();
         Session session = Session.getInstance(props, null);
         javax.mail.Message message = new MimeMessage(session);
             // Open the packet source . . .
             reader.open(PrintStreamMessenger.err);
             // Set a threshold boolean to be used so
             // email is sent only once after threshold
             // is exceeded.
             Boolean limit = false;
             for (;;) {
              // The node ID field in the OscilloscopeRF packet
              // is 2 bytes long, but all byte pairs in the packet
              // are in little endian order.  Thus, the bytes must
              //  be re-ordered.  They are then converted to unsigned
              // integers and added together to obtain the node ID.
              byte[] packet = reader.readPacket();
              Integer nodeID = (( int ) packet[5] & 0xFF) + ((( int ) packet[6] & 0xFF)<<8);
              System.out.printf("Packet from node %d . . . \n", nodeID);
              // Begin extracting data payload of sensor readings,
                    // which are stored in the last 20 bytes of the packet . . .
             for (i = 0; i <= 9; i++){
              // Convert reading to integer, display on screen . . .
              Integer sensorData = (( int ) packet[(2*i)+11] & 0xFF) + ((( int ) packet[(2*i)+12] & 0xFF)<<8);
              System.out.printf("Sample %d reading at %d lux.\n", i+1, sensorData);
              // Is sensor reading  above limit?
              if(!limit && (sensorData >= threshold)){
                  limit = true;
                  System.out.printf("WARNING: SENSOR READING ABOVE THRESHOLD--SENDING NOTICE BY TEXT MESSAGE.\n");
                  // Compute a time stamp for when threshold was exceeded.
                  java.util.Locale locale = Locale.getDefault();
                  java.text.DateFormat dateFormat = java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.LONG,
                                                                  java.text.DateFormat.LONG, locale);
                  timeStamp = dateFormat.format(new java.util.Date());
                  // Build message and send to recipients in mailing list . . .
                  message.setFrom();
              message.setRecipients(javax.mail.Message.RecipientType.TO, InternetAddress.parse(to, false));
              message.setSubject("WARNING: NODE " + nodeID.toString() + " SENSOR READING ABOVE THRESHOLD!");
              message.setText("Node " + nodeID.toString() + " sensed " + sensorData.toString() + " lux on " + timeStamp + "\n");
              Transport.send(message);
                  System.out.printf("%s\n",timeStamp);
              //  Has sensor reading now dropped from above threshold to below threshold?
              //  Same concept as before . . .
              if(limit && (sensorData < threshold)){
                  limit = false;
                  System.out.printf("READING BELOW THRESHOLD AGAIN . . . SENDING NOTICE BY TEXT MESSAGE.\n");
                  java.util.Locale locale = Locale.getDefault();
                  java.text.DateFormat dateFormat = java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.LONG,
                                                                  java.text.DateFormat.LONG, locale);
                  timeStamp = dateFormat.format(new java.util.Date());
                  message.setFrom();
              message.setRecipients(javax.mail.Message.RecipientType.TO, InternetAddress.parse(to, false));
              message.setSubject("NODE " + nodeID.toString() + " READING BELOW THRESHOLD AGAIN.");
              message.setText("Node " + nodeID.toString() + " sensed " + sensorData.toString() + " lux on " + timeStamp + "\n");
              Transport.send(message);
                  System.out.printf("%s\n",timeStamp);
             System.out.println();
             System.out.flush();
         // Catch IOException from Tiny OS java method, and
         // MessagingException from setRecipients method in JavaMail API . . .
         catch (IOException e) {
             System.err.println("Error on " + reader.getName() + ": " + e);
         catch(MessagingException e){
         System.err.println("Error in javax.mail.message.setRecipients:\n" + to);
    }

  • Using ECATT to send messages to XI repeatedly

    Hi experts,
    I just learned that it is possible to test webservices with ECATT.
    My question is now, if I could youse ECATT in order to send messages to XI repeatedly.
    This means I would like to create a "Test" where I specify which interface on XI I wat to adress and ECATT would automatically replace some entries in a message and would send this message as often as specified.
    Hope you can help me there.
    Regards,
    Sebastian

    Hi Hemant,
    this already helps. Unfortunately I do not really have a deep knowledge of ECATT - so it would be great if you would have some further information how I could create a script that is sening and manipulating a message?
    Do you have any documentation or hints?
    Thanks & Regards,
    Sebastian

  • TCP/IP Server Socket using Java Proxy (Sender) ?

    Hi,
    I have requirement to listen certain port for third party POS system using TCP/IP Socket. Since there is no standard SAP TCP/IP Socket Adapter. I am planning to develop using Sender Java Proxy.
    Please advise whether this approach is workable ? or is there any related blog / forum discuss about Socket Server.
    This blog is only for socket client /people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi
    Thank You and Best Regards
    Fernand

    When you want to have minimal effort, you can create a standalone Java program which listens on a port and transforms the incoming tcp/ip stream to an HTTP message, which you can send to SAP PI.
    With more effort you can create an TCP/IP adapter by your own, according to JCA architecture.
    A sender Java proxy does not have any runnable code itself, so the problem to create a listened is not solved.

  • My iMessage will not use wifi to send messages unless the phone is on Airplane mode

    I cannot send or receive texts at home because there is insufficient service at my house so I use iMessage over wifi. The issue is that when I am on wifi and out of service the phone will not send iMessages or texts over wifi unless the phone is in Airplane mode. Does anyone know how to make wifi the default iMessage so that I can send iMessages over wifi without going to Airplane mode? It tries to send them but it acts as if there is no service when I have full wifi and as soon as I switch to Airplane mode and keep wifi connected, all messages send fine.

    Do the basic troubleshooting steps, as needed, described in the User Guide, Appemdix B: restart, reset, restore using a backup, restore as new.

  • Host my Domain for a low cost? and use DSL to 'send' messages...How?

    How does one get a DOMAIN plus 2 - 5 email addesses 'hosted at a very low yearly cost?
    I looked at technopagan's list of Dynamic DNS providers... did not see my provider (ATT - DSL) on it.
    IF I could afford such an ISP, I could RECEIVE all mail there (but continue to SEND mail thru DSL ,,, since they demand that I do !)
    Now, I do have a "free" ISP that does the above... (receive mail ONLY... send out via ATT-DSL); but I may lose it soon then I have to CHANGE email addresses etc etc over to ATT DSL... don't want that. I want a more 'permanent' change ... and maybe with my own domain and email address(es) that stay with me.
    Kappy DID answer my last post but it got "lost" on an Apple server somewhere...
    Cheers, Jim B

    Have you checked out GoDaddy?
    http://www.godaddy.com/gdshop/compare/gdcompare_netwrk.asp?isc=goox1001bd
    There is Yahoo Small Business.
    http://smallbusiness.yahoo.com/domains/
    A Google search is your friend - try domain names or domain name for the search.

  • How can I create a schedule in Java for sending mail from SAP?

    Hello;
    I am coding a programme in Java which reads data from KM. I wish to schedule a job which sends mail to a list of persons selected from KM. I read the article by Prakash Singh and based my programme on his explanations.
    /people/prakash.singh4/blog/2005/04/20/did-you-know-you-can-schedule-jobs-in-portal-using-kms-scheduler-task
    My first problem is that I don't know how to send mail in SAP, and how to use Java to send this mail. My second problem is how to develop this "schedule job" function - is it enough to use Prakash Singh's method, or does it need to be changed?
    Can anyone help me with these questions?
    Thank you very much, R.E.

    Hi,
    I dont know about the CATS system. But when ur user selects the varaint, he should remove his own id and execute the query. This should display all the variants existing for that program. Then he can select the required variant.
    The user can also save this varaint under his own ID
    Hope it helps.
    Regards.
    Jay Gandhi

  • How to use the http sender adapter

    Hi,
    I'm trying to use the http sender adapter but not getting the result.
    1)  I've created the commnunication channel in Integration Directory.
    2)  I have my url:
    http://<server>:56000/sap/xi/adapter_plain?service=BS&namespace=urn%3Acompany%3Apoc&interface=interface
    3)  When i copy that url in a browser i get a login prompt. When i log in i get a message that navigation is cancelled.
    What steps do i need to do to use this url to send my xml message to the adapter engine. Do i need a special system user for this? Any other tools required? (i have httpclient but using that doesnt send messages to the adapter_plain; i think)
    I feel i'm just missing one little thing, but what is it.
    kr
    Robert

    Hello Team,
    I added the user name & pwd to query string & trying to access from IE and still getting blank page.
    Is this what is expected or there is something wrong in URL. I am able to send the XML from HTTP Test tool.
    My URL is :
    http://abc:50000/sap/xi/adapter_plain?namespace=urn:xyz.com:A_To_ERP_Payment_balance_Request&interface=SI_A_CHK_balance_OUT&service=BC_XX_XXX&sap-user=myuser&sap-password=mypassword&sap-client=001&sap-language=EN
    Please advice.

  • Sms send message VI Dialog box

    Whenever I get an error using the SMS Send Message.vi I get a dialog box that disables my program unless I manually answer the prompt.  Can NI (or anybody else) please
    1. Have an option to disable the dialog box
    2. Unpassword protect the VI so I can do it myself
    3. Give me some other option I missing.
    Thank you
    Robert

    Hi Robert,
    Since the Clear Errors VI is not available with a PDA application, you can use a case structure to clear errors instead.  Wire the error out of SMS Send Message to the case selector.  In the Error case place an error cluster constant (right click on error out and Create >> Constant) to pass through the remainder of your program.  For the No Error case, pass the error wire straight through. 
    Message Edited by Jennifer_R on 02-04-2008 06:54 AM
    Jennifer R.
    National Instruments
    Applications Engineer
    Attachments:
    Clear Error.JPG ‏5 KB

  • Telling java to send an email

    I want to use a dosubmit option but not to a web site, but to an email. is there a way that i make a script to have java send the information inputed to an email? if so what are some examples of codes that i can use?
    Thanks!!!

    I want to use a dosubmit option but not to a web
    site, but to an email. is there a way that i make a
    script to have java send the information inputed to
    an email? if so what are some examples of codes that
    i can use?
    Thanks!!!Using java to send emails, check Java Mail API
    http://java.sun.com/products/javamail/
    but you'll need an smtp server
    Manuel Leiria

  • How can local user send message to other user via OSX server in mac maverick

    I just install OS X server in mac mavericks and enable services such as message, DNS, VPN, etc. I also create local users and local network users. I add some local users from OSX server to Message app in order to message to server, but I cannot send any message to those user, even Bonjour is available but I cannot use it to send message in local network.
    I already followed all Server Help in Messages like in this image:
    I try to access to my local OS X server via IP address by using other PC, Mac and iPhone and I can get this interface:
    I already try in iPhone to send message to local user in OS X server after accessing to OS X server via IP Address, but I don't know how local user can get that message and I see nothing in message_archives of message data of server. Therefore, how each user in OSX server can message to each other across OSX server ? Does Admin have to write some codes or make configuration for providing message services to those users ?
    Message was edited by: chhanmalin

    Client users need to use XMPP client app to log in to server with account name like in server , then user can send message to other users in server. Client users can use iphone, pc, or mac.

  • B2B using JMS and Processing Messages with Message Driven Beans

    We want to be able to use B2B to send messages to a JMS queue and then process messages from B2B using a Message Driven Bean. Is this supported.
    We are using B2B 10.2.0.2 with Patchset 4.

    Hello,
    In 10.1.2.0.2 B2B , as part of the internal Delivery channel B2B can only send and receive messages from JMS queues.
    Rgds,Ramesh

  • SMTP Email Send Message Error

    When I using SMTP Email Send Message in Labview 8.0 to send an email message and I get a error message as bellow:
    Error 16500 occurred at 500 5.5.1 Command unrecognized: "MIME-Version: 1.0"
    Possible reason(s):
    LabVIEW:  (Hex 0x4074) 500 Syntax error, command unrecognized. For example, the command line might be too long.
    Where the mistake and how to solve this error to send an email by Labview 8.0.
    Thank you.

    A couple of things. If you don't know what mail server you are using, you definitely need to get a hold of a network administator to see which one you use. Checking the mail server is a thing specific to the mail server itself, in other words there is no specific way that applies to them all. The example below requirs FDS 7.0 so if you don't have full developement system, it won't work. The handset question would be a great one to ask in another thread. I suggest also searching our website for information on that one as well. Hope that answers your questions.
    Tyler H.
    National Instruments
    Attachments:
    sendEmail.vi ‏66 KB

Maybe you are looking for