I have set up simple server and client, but i don't no how to send message from xmpp server to client. Please give me some help. If possible then suggest me some links.
sending message from xmpp server vysper in java
1.4k Views Asked by Awais Tariq At
1
There are 1 best solutions below
Related Questions in JAVA
- Concatenate excel cell string within cell reference string
- Use hidden information for filtering data
- Using Vlookup in Excel sheet to match substring
- Import from api into multiple excel cells
- Loop through list of files and open them
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Loop with equation for upper limit
- excel vba null value in array
- Why is my xml file having these after convert from excel?
- TextToColumns function uses wrong delimiter
Related Questions in XMPP
- Concatenate excel cell string within cell reference string
- Use hidden information for filtering data
- Using Vlookup in Excel sheet to match substring
- Import from api into multiple excel cells
- Loop through list of files and open them
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Loop with equation for upper limit
- excel vba null value in array
- Why is my xml file having these after convert from excel?
- TextToColumns function uses wrong delimiter
Related Questions in APACHE-VYSPER
- Concatenate excel cell string within cell reference string
- Use hidden information for filtering data
- Using Vlookup in Excel sheet to match substring
- Import from api into multiple excel cells
- Loop through list of files and open them
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Loop with equation for upper limit
- excel vba null value in array
- Why is my xml file having these after convert from excel?
- TextToColumns function uses wrong delimiter
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This is a question which surprisingly often comes up for Vysper. There are several reasons for even asking the question, one particular reason I think is that a HTTP web server in fact works in such a way that it creates and sends content (HTML, CSS etc.) to the agent a.k.a. web browser.
In message-based protocols like email and chat this is a bit different.
Emails are created and consumed by the agents a.k.a. the email clients. Servers mostly only act as Message Brokers (http://en.wikipedia.org/wiki/Message_broker), including aspects like authentication, filtering, storing etc. Rarely do they produce their own email messages out of themselves. Often, a few central accounts (e.g. [email protected], [email protected]) create most of the emails, meaning that the actual messages are produced by an email client and delivered by the server on behalf of the client. (Additionally, email/SMTP has the specialty that clients send out email directly to the receiver's email server which is a nightmare going by the name of /spam/.)
In general, XMPP is no difference here. XMPP chat clients connect and send out and receive messages. The XMPP server brokers the messages. So, to answer your question, in most cases it is sufficient and suggested to have a central account communicating with all the other accounts. It's the simplest and best solution.
However, XMPP offers a little bit more than chat. It has extensions for wizzard-like workflows based on forms, publish/subscribe and administation/commands.
You can add your own extension, if you really need to:
For example, have a look at the VCard extension here: http://svn.apache.org/viewvc/mina/vysper/trunk/server/core/src/main/java/org/apache/vysper/xmpp/modules/extension/xep0054_vcardtemp/
Foremost, I'd recommend to subclass org.apache.vysper.xmpp.modules.core.base.handler.DefaultIQHandler This is like implementing your own Servlet by subclassing DefaultServlet. It contains the XMPP stanza logic you want to provide.
Additionally, you need to plug your handler into the server. This is best done by following the example in VcardTempModule, which
If you need persistence, have a look at the VcardTempPersistenceManager.
What remains to be done is to make your Module known to the server. If you use Spring, add one line to the Spring configuration. If you use an embedded approach, you'd need to call the equivalent to server.addModule(new VcardTempModule()); like it is done in org.apache.vysper.xmpp.server.ServerMain
Now, if you'd want to emit new Stanzas (messages) which are not a reaction to other Stanzas going through the server, you'd also need to start off your own Thread which is able to create and send Stanzas.
But again, the preferred way is to have the clients create all messages.