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 answers
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in XMPP
- How to Implement Chatbot at Scale
- How to connect Openfire with Kotlin
- Having trouble with node.js client joining a XMPP Prosody room
- Connecting to Openfire server from browser using xmpp.js
- Flutter xmpp_plugin - App crashes when open the app again
- XMPP - Openfire Subgroup
- Does the XMPP receipy still work in Franz
- Unable to retrieving chat history using Strophe.js and Ejabberd with XEP-0313: Message Archive Management (MAM)
- Integrate XMPP Openfire STUN server with client side js web application
- How to define a shaper in ejabberd for websocket connections?
- Accessing Content in XMPP PubSub Event Using pubsub:published Event (StanzaJS)
- Can xmpp server admin influence usage of omemo?
- is there anyone help me about this p2 ejabberd error?
- ejbberd : How to make IQ Handler parallel?
- Setup Ejabbered on a VPS
Related Questions in APACHE-VYSPER
- XMPP wrong sender address (broadcast serverside)
- Apache Vysper with Smack 4.1.8 client library - how to handle the TLS certificate?
- Apache Vysper - XMPPServer ClassNotFoundException
- Example on how to use Vysper xmpp with smack
- Can an embedded XMPP server in a Java EE container be harmful because of threads?
- vysper address already in use
- How to configure vysper api to communicate from one xmpp server to another xmpp server
- Create an external component to a Openfire
- jabber-net and vysper message broadcast facility
- jabber-net onAuthenticated doesn't get called
- how to run apache's vysper xmpp server
- XMPP Server Vysper vs. OpenFire/Tigase (how to create simple XMPP server)
- Implementing WebSocket on Spring MVC based Server
- XMPPClient with vysper server gets no response
- sending message from xmpp server vysper in java
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?
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)
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.