How to implement asynchronous mailing in SE

Hi,
I have a stand-alone application which requires to send mail as "fire and forget".
I use only java SE. Can i implement it using javax.mail alone or should i go for jms.
Thanks.

itsraja wrote:
for asynchronous sending of mails.Okay, but why do you think you'd need JMS for that? What is it that you think JMS is for?
I have two files in a package. One the application program. And the other that sends mail using javax.mail. I call this object's method from the application. But i want the application to continue processing immediately after invoking the mail object. I don't want to make it wait for sending mail.So you want multithreading.

Similar Messages

  • How to call Asynchronous RFC

    Hi Everybody,
                Could yo pls guide me on how to implement asynchronous RFC. When i run my RFC using Report :
    CALL FUNCTION 'Z_HR_NO_ALTINN_TX'  DESTINATION 'Q3A2X7A'starting new task 'test'
      exporting
        PASSWORD = 's'.
    I get the error saying :
    <b>What happened?</b>
        When executing the asynchronous RFC, the RFC destination "Q3A2X7A" had
        neither an internal (connection type 'I') nor an R/3 communication
        type (connection type '3'.
        Error in ABAP application program.
        The current ABAP program "Z_ALTINN_TEST" had to be terminated because one of
         the
        statements could not be executed.
        This is probably due to an error in the ABAP program.
    <b>Error analysis</b>
        A typical cause of error is the
        execution of external programs (RFC destinations of the type
        TCP/IP) via asynchronous Remote Function Call (RFCs with the
        addition 'STARTING NEW TASK taskname').
        RFC destination... "Q3A2X7A"
    I would like to know if async RFC call is possible to XI.
    Regards,
    Raj

    Hi,
    you need to call the RFC from ERP, R3
    with
    call function XXXXX
    <b>in background</b>
    and Commit work.
    Regards,
    michal

  • How to Implement custom share functionality in SharePoint 2013 document Lib programmatically?

    Hi,
    I have created custom action for Share functionality in document library.
    On Share action i'm showing Model pop up with Share form with addition functionality.
    I am developing custom share functionality because there is some addition functionality related to this.
    How to Implement custom share functionality in SharePoint 2013  document Lib pro-grammatically?
    Regards,
    - Siddhehswar

    Hi Siddhehswar:
    I would suggest that you use the
    Ribbon. Because this is a flexible way for SharePoint. In my project experience, I always suggest my customers to use it. In the feature, if my customers have customization about permission then i can accomplish this as soon
    as possible. Simple put, I utilize this perfect mechanism to resolve our complex project requirement. Maybe we customize Upload/ Edit/ Modify/ Barcode/ Send mail etc... For example:
    We customize <Edit> Ribbon. As shown below.
    When user click <Edit Item>, the system will
    render customized pop up window.
    Will

  • How to configure the mail in Sales Support of SAP SD

    Hi,
    Experts I have one scenario in my co. that we have 300 users we have to send the mails to our 300
    users for every 2 or 3 months once. Regarding new promotions (Discounts , Price changes) of
    company.  For this every time we are changing the sold to party in quotation and taking printouts then
    sending to our users its a lengthy procedure, to avoid this long time very soon we are going to
    implement SAP SD Sales Suppor in our company is there any functionality in SAP to send mail at
    once to our 300 users  may i know about how to configure the mail for this scenario.
    Thanks and Regards
    MH

    Hi  Prashant,
    Thanks for you immediate responce, Can you give me the configuration steps in detail.
    Thanks and Regards,
    MH

  • How to send a mail on a particular date

    hello everybody.
    i am developing a greeting site.
    where in i need to send a mail on a particular date, which is greater than today. how can i send mail on a pre selected date.
    my server is IIS and i am using java servlets and java mail api.
    please tell me if anybody having the solution.
    or please mail me to [email protected]
    thank you
    sambareddy
    hyderabad

    As far as I know there is no method in JavaMail for sending a message on a particular date.
    However you can use the Java.util.Timer and java.util.TimerTask class to do this.
    In the class that you send your message from
    public class SendMessage extends TimerTask{
    public void run(){
    //send message here
    TimerTask implements Runnable so a thread can be created here.
    To call the thread:
    public class CallMessage{
    public static void mail(String args[]){
    SendMessage sm = new SendMessage();
    Timer timer = new Timer();
    timer.schedule(sm, 10000, 10000)
    //wait for 10 seconds and repeat in 10 seconds
    There are a number of different schedule methods available for whatever you need to do.
    Hope this helps!

  • How to implement an independent static stub client ? Please, help

    Hi everybody!
    I'm using the jwsdp1.2 and i got the static stub tutorial client to test my webservice. It works fine! However, i tried to compile the client code separately and it didn't worked. The jvm can't find the webservice class. So, the questions are:
    - How to implement an independent static stub whithout the ant help?
    - How can the client get the endpoint to create the proxy?
    - Must I use any javax.xml.rpc interface (call or service maybe) to do the job?
    - Could anybody show me some sample code?
    Well, that's it. I'm waiting for some answer. Please, help me.
    Tks in advance,
    Rodrigo.

    Can you explain what you mean by "independent static stub" ?
    JWSDP Tutorial explains all the steps required to create a static stubs client and invoke the service. In addition, https://jax-rpc.dev.java.net/whitepaper/1.1/index-part2.html#Scenario2 explains the detailed steps to achieve the same from command line.
    Hope that helps.
    Post your JAX-RPC related questions to [email protected] for a quicker resolution.
    Send an email to [email protected] to subscribe to the alias.
    Send an mail to [email protected] for a complete list of help commands.
    -Arun

  • Implementing a mail queue using ArrayBlockingQueue

    I'm trying to implement a mail queue using an ArrayBlockingQueue but seem to only be able to send the list address; so if I have mail for foo, bar and baz, only baz is being emailed but not foo and bar. I'd be grateful for a pointer as to how to get it returning the whole list.
    public class buildMail implements Callable<MimeMessage> {
         private Logger log = Logger.getLogger(buildMail.class);
         private MimeMessage msg;
         private Calendar cal;
         private String from;
         private String subject;
         private Session sess;
         private HashSet<String> members;
         private Transport tr;
         private ArrayBlockingQueue<MimeMessage> mailqueue;
         public buildMail(Session sess, Calendar cal, String from, HashSet<String> members, String subject, Transport tr) {
              this.sess = sess;
              this.cal = cal;
              this.from = from;
              this.members = members;
              this.subject = subject;
              this.tr = tr;
         public MimeMessage call() {
              mailqueue = new ArrayBlockingQueue<MimeMessage>(20);
              try {
                   //iterating through the members array to create individual messages for sendMessage
                   for (String to: members) {
                   msg = new MimeMessage(sess);
                   msg.setFrom(new InternetAddress(from));     
                         msg.setRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(to));
                      msg.setSubject(subject);
                         msg.setSentDate(new Date());
                         CalendarOutputter co = new CalendarOutputter(false);
                         Multipart multipart = new MimeMultipart();
                         MimeBodyPart messageBodyPart = new MimeBodyPart();
                         Writer wtr =  new StringWriter();
                         co.output(cal, wtr);
                         String content = wtr.toString();
                         messageBodyPart.setDataHandler(new DataHandler( new ByteArrayDataSource(content, "text/calendar")));
                         multipart.addBodyPart(messageBodyPart);
                   msg.setContent(multipart);
                   log.info("Offering " + msg + "to mail queue going to " + to);
                   mailqueue.put(msg);
                   log.info("Mail Queue is " + mailqueue.size());
                   sendMessage(mailqueue);
              } catch (Exception e) {
                   e.printStackTrace();
              return msg;
           }//end run
         public Object sendMessage (ArrayBlockingQueue<MimeMessage> mailqueue) {
              try {
                   tr.connect();
              } catch (MessagingException mex) {
                   mex.printStackTrace();
              while (!mailqueue.isEmpty()) {
                   try {
                        mailqueue.remove();
                        tr.sendMessage(msg, msg.getRecipients(javax.mail.Message.RecipientType.TO));
                        log.info("Sending message ");
                        Thread.sleep(500);
                        if (mailqueue.isEmpty()) {
                             tr.close();
                             log.info("mailqueue is empty");
                             break;
                   } catch (Exception ie) {
                        ie.printStackTrace();
              while (mailqueue.isEmpty()) {
                   try {
                        tr.close();
                        mailqueue.poll(250, TimeUnit.MILLISECONDS);
                   } catch (Exception e) {
                        e.printStackTrace();
              return null;
    }//end buildMailThe size of the mail queue and the previous line suggest that the foreach loop is putting the entire list into the queue but only one email is ever returned.

    if I have mail for foo, bar and baz, only baz is being emailed but not foo and bar.this
    mailqueue.remove();
    tr.sendMessage(msg, msg.getRecipients(javax.mail.Message.RecipientType.TO));where msg is the last one which comes from "call" method the "msg" reference variable has the scope of class variable so I guess it is teh last one which is "baz"
    you want to empty the mailquque and you are not assigning it to a variable to be send
    such as
    MimeMessage myMsg = mailqueue.remove();
    and
    tr.sendMessage(myMsg,...);
    Then what was the reason behind waiting for a timeout period after check the quque if it is empty and then try to poll ( blocks until timedout)
    is there a reason behind the below
    while (mailqueue.isEmpty()) { // is there another thread tries to populate the queue when it gets empty
                   try {
                        tr.close();
                        mailqueue.poll(250, TimeUnit.MILLISECONDS); // here
                   } catch (Exception e) {
                        e.printStackTrace();
              }Regards,
    Alan Mehio
    London,UK

  • How to Implement Async JAX-WS 2.1 Service

    I would appreciate some guidance, or links to documentation, on how to implement an asynchronous JAX-WS 2.1 web service (note that I am NOT asking how to implement a client program that invokes a JAX-WS web service asynchronously b/c BPEL will be invoking the service).
    Ultimately, what I need to accomplish is to:
    (a) implement a JAX-WS web service that can be invoked asynchronously
    (b) deploy that JAX-WS web service to Oracle WebLogic 10.3 and
    (c) invoke the JAX-WS web service asynchronously from Oracle BPEL Process Manager 10.1.3.3.
    As an example, let's say I have the following class that I'd like to expose as an async JAX-WS web service:
    <pre>
    public class EngineConfigurationService
    public Configuration configureEngine(ConfigurationRequest aRequest)
    //....arbitrary amounts of long-running computation happens here...
    return configuration;
    </pre>
    How would I annotate this class to allow it to be consumed as an async JAX-WS web service? Would I need any other classes (e.g., a "response" class)?
    Thanks in advance for any help.
    Dave

    I recently developed a test async web service and deployed it on weblogic 9. What I did was 1.) create a java class with with standard ws annotations.
    2.)Compile it using jwsc ant task setting the attribute enableAsyncService="true".
    I am pasting the java file and the ant target here for your reference.
    <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask" classpathref="classpath.basic"/>
    <target name="buildWebService">
         <jwsc
         srcdir="${basedir}/src/com/test/"
         sourcepath="${basedir}/src/com/test/"
         destdir="${basedir}/build"
         classpathref="classpath.basic"
         keepGenerated="true"
         enableAsyncService="true"
         debug="on">
         <module contextPath="TestAsyncWS" name="TestAsyncWS" explode="false" >
              <jws file="TestAsyncWS.java">
         <WLHttpTransport contextPath="TestAsyncWS" serviceUri="TestAsyncWS" portName="TestAsyncWS" />
         </jws>
         <FileSet dir="${basedir}/src" >
         <include name="**/*.java" />
         </FileSet>
         </module>
              </jwsc>     
         </target>
    and here is the java class
    package com.test;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    @WebService (name = "TestAsyncWS", targetNamespace = "java:com.test")
    public class TestAsyncWS
         public TestAsyncWS()
         @WebMethod()
              public String sayHello(String textToDisplay)
              String result = "I can still work.Here is what you sent to me. "+ textToDisplay;
              System.out.println(result);
              try {
                   Thread.sleep(20000);
              } catch (InterruptedException e) {
                   e.printStackTrace();
              return result;
    }

  • Implementing Java Mail Service

    Hello,
    we' d like to implement email-functionality through the portal. We would like every user to see his inbox and to be able to send mails to outside our domain.
    I used standard iView com.sap.netweaver.coll.SendEMail for implementing the "send"-functionality. Although i cant see the mail system i created in systemlandscape in user mapping, i m quite surprised it works!
    Every user is able to send email in his own name via our mail server mail.company.com.
    Can you explain this phenomenon? How can I access the users inbox?
    Thanks for your hints
    Markus

    Hi Markus,
    > I know how to implement mail-connectivity in EP5.
    > Unfortunately the configuration changed in EP6.
    That's what I've explained.
    > Could u give me any hint how to configure
    > an inbox iview?
    If you want to see incoming mail, you have to connect to the server in question, but the standard way supported is using the corresponding native web client, see http://help.sap.com/saphelp_nw04/helpdata/en/7c/6a469702474146a8ef2f97fe880b2f/frameset.htm
    E.g. for integrating Outlook see https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/g-i/integration of outlook web access into sap enterprise portal.pdf
    Hope it helps
    Detlev
    PS: Please remember to consider rewarding points...

  • How to implement callback?

    Hi all!
    I want to use asynchronous callback between two JBI components.How to implement it using EPR?If EPR is used,must I use WS-Addressing and SOAP message?
    In addition,can another alternative way do it in JBI's message lay?For example,in CORBA,we may send client's ReplyHandler reference to server, so server's response will be delivery to client's ReplyHandler object by ORB.
    thanks!
    Spliu

    The simplest way to implement asynch callback is to use the properties of the MessageExchange instance. Simply attach the callback object to the message exchange instance, and send the instance off to be processed. When the component receives the response in the MessageExchange instance, it can simply retrieve the callback object and invoke it with the response.
    Using EPRs is more difficult, for it requires that both components agree on how such references are passed between them. Any EPR vocabulary (eg, WS-Addressing) can be used; generally only one component "understands" the EPR vocabulary (usually a binding component); the other treats it as an opaque XML fragment that it passes to JBI in exchange for an EndpointReference.

  • How to implement a print screen through a java program rather than a keyboa

    help needed urgently to make a college project.
    have to capture whatsoever is on the client screen
    and sent it to to a server program where it will be made visible on a frame or panel.
    this is to be done without the client ever knowing it.
    so needed to implement a printscreen command using java code and put it in a program(also how to make
    the .class file containing this code run in the background all the time since the client comp starts till it is shut down without the client ever knowing it)
    e mail: [email protected]

    <pre>
    hartmut
    i need help.
    i've recently started using the web to learn more about java.your reply was very discouraging.
    the proff. just wants a decent project.
    but i want to make this project to improve my java networking skills.
    if you can help , please tell me how to implement a printscreen through a java program rather than a keyboard.
    I'll be very grateful to you if you can help me in this regard, but please dont send a dissapointing response like the previous one.
    mail: [email protected]
    </pre>

  • Implement asynchronous web calls

    how java going to implement asynchronous web calls in a java based web service

    Are all of the result handlers getting called?
    Declare fault handlers as well, perhaps that will give you
    more information.
    I call multiple operations against the same WebService
    instance and the same Web Service (implemented in VB.net)with no
    chaining, and have no problems
    Tracy

  • Implementing Asynchronous comm. in WebService & its client

    Hi Friends,
    I am trying to implement Asynchronous communication between a WebService & its Client. I am using Sun JWSDP 1.6.
    My doubts are:
    1. Is there any difference in WSDL? If yes, then What?
    2. What are the differences in WSDL for
    a. Client Call-Back or
    b. Polling
    3. How to use JWSDP to implement such communication?
    Thanx in advance.

    Thanks swatdba,
    I came to know later that JWSDP 1.6 doesnt have support for Asynchrony, but my concern is about WSDL.
    * What needs to be published in WSDL for Asynchronous support in WebService?
    * I studied WSDL of an Asynchronous BPEL process. It has
    2 Service endpoint definition,
    2 Ports and
    2 Bindings
    - One for Request and the other for CallBack
    Can anyone explain me what does it mean? Is there any way to create client for that (other than JAX-WS 2.O)?

  • HT4898 how do you syn mail after moving to icloud

    How do you syn mail after moving to iCloud?

    Yes, you can use iCloud mail with OS X 10.6.8. However you need to enter the account details manually using the Mail Server Information  

  • How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?

    Hi
    If a organization have 200 to 300 daily complains of there IT equipment/Software/Network e.t.c.
    How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?
    Is there any standard DataSources/InfoObjects/DSOs/InfoCubes etc. available in SAP BI Content?

    Imran,
    The point I think was to ensure that you knew exactly what was required. A customer service desk can have many interpretations from a BI perspective.
    You could have :
    1. Operational reports - calls attended per shift , Average number of calls per person , Seasonality in the calls coming in etc
    2. Analytic views - Utilization of resources , Average call time and trending , customer satisfaction , average wait time
    3. Strategic - Call volumes corresponding to campaigns etc , Employee churn and related call times
    Based on these you would then have to construct your models which would be populated by data from the MySQL instance for you to report.
    Else if you have BWA you could have data discovery instead or if you have HANA - you could do even more and if you have a HANA sidecar - you technically dont need BW. The possibilities are virtually endless - it depends on how you want to drive it and how the end user ( client ) sees value in the same.

Maybe you are looking for

  • Question on WCCP and ASA/VPN

    Hello i have this simple scenario. -ASA as an EZVPN server. -WSA in my local lan (inside interface) -remote vpn users connecting to the ASA. When a user connects via VPN to my ASA, and i want to do some web filtering to them using the WSA... How woul

  • Home wireless network in China using Airport Express ?

    I am going to be living in China with my Macbook. I will be bringing my Airport Express with me. I would like to know whether it is appropriate to connect up my Airport Express to a Chinese cable modem to obtain wireless internet access at home. Or i

  • Simulator build needed for Single-edition DPS App

    Hi everyone! We're trying to embed our App into our site with one of those sites that offers that kind of service, but they're asking for a simulator build and won't accept .ipa files or even the distribution .zip for the App store. They do offer a p

  • Prompt Default Value based in drilled result

    I am navigating(drill using action link) from an analysis to a dashboard where I have a prompt for currency. I want this to be initialized to a dynamic default value based on the column values. Master Analysis Country valid currency Drill India C1 Li

  • Export the file names of an iPhoto Album

    Hi,     I have gone through some of the communities but did not find the answer and posting here. I want to export only the file names of photos of an iPhoto Album.  (Please post if I can get them through Terminal) Thanks Raj.