A modular and portable open source XMPP client library written in Java for Android and Java (SE) VMs



Build Status Coverage Status Project Stats Link to XMPP chat smack@conference.igniterealtime.org


Smack is an open source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android.

A pure Java library, it can be embedded into your applications to create anything from a full XMPP instant messaging client to simple XMPP integrations such as sending notification messages and presence-enabling devices. Smack and XMPP allows you to easily exchange data, in various ways e.g. fire-and-forget, publish-subscribe, between human and non-human endpoints (M2M, IoT, …).

More information are provided by the Overview.

Getting started

Start with having a look at the Documentation and the Javadoc.

Instructions on how to use Smack in your Java or Android project are provided in the Smack Readme and Upgrade Guide.


Most of Smack is governed by the Apache License 2.0 (SPDX License Identifier: Apache 2.0). This license requires that the contents of a NOICE text file are shown "…within a display generated by the Derivative Works, if and wherever such third-party notices normally appear.".

Smack comes which such a NOTICE file. Moreover, since smack-core is licensed under the Apache License 2.0, the conditions apply to every project using Smack. The content of Smack's NOTICE file can conveniently be retrieved using Smack.getNoticeStream().

Some subprojects of Smack are governed by other licenses. Please refer to the individual subprojects.

Professional Services

Smack is a collaborative effort of many open source, professionally and spare-time, paid and unpaid, contributors. While we try to provide the best possible XMPP library for Android and Java SE compatible execution environments by following state of the art software engineering practices, the API may not always perfectly fit your requirements. We welcome contributions and encourage discussion about how Smack can be further improved. We also provide paid services ranging from XMPP/Smack related consulting to designing and developing features in order to accommodate your needs. Please contact Florian Schmaus for further information.

Bug Reporting

Only a few users have access for filling bugs in the tracker. New users should:

  1. Read "How to ask for help or report an issue"
  2. Create a discourse account (you can also sign up with your Google account).
  3. Login to the forum account
  4. Press "New Topic" in your toolbar and choose the 'Smack Support' sub-category.

Please search for your issues in the bug tracker before reporting.


If you find Smack useful and feel like donating, then you can use one of the following systems:

  • Donate via Bitcoin: 1LiU78z3498wu3jwRPKbvovKAHjTcpVbuK


The developers hang around in [email protected] You may use this link to join the room via inverse.chat. Remember that it may take some time (~hours) to get a response.

You can also reach us via the Smack Support Forum if you have questions or need support, or the Smack Developers Forum if you want to discuss Smack development.


If you want to start developing for Smack and eventually contribute code back, then please have a look at the Guidelines for Smack Developers and Contributors. The guidelines also contain development quickstart instructions.


Ignite Realtime

Ignite Realtime is an Open Source community composed of end-users and developers around the world who are interested in applying innovative, open-standards-based RealTime Collaboration to their businesses and organizations. We're aimed at disrupting proprietary, non-open standards-based systems and invite you to participate in what's already one of the biggest and most active Open Source communities.

Smack - an Ignite Realtime community project.

  • Implementation of XEP-0313: Message Archive Management (MAM)

    Implementation of XEP-0313: Message Archive Management (MAM)

    Documentation: http://xmpp.org/extensions/xep-0313.html

    opened by ramabit 32
  • XEP-0191: Blocking Command implementation

    XEP-0191: Blocking Command implementation

    Documentation: http://xmpp.org/extensions/xep-0191.html

    opened by ramabit 23
  • Added pubsub Node.modifySubscriptionsAsOwner

    Added pubsub Node.modifySubscriptionsAsOwner

    This is a simple insertion of a new function, calling existing functions.

    I hope this is the right kind of test (i.e. I copied the right one) !

    I haven't yet tested it in a real xmpp client, connected to a real server (test will against my Openfire server...).

    More than anything I'm making sure I've got the whole fork/code style/commit/pull request system correct !

    opened by TimothyPitt 19
  • Rework support for XEP-0384: OMEMO Encryption

    Rework support for XEP-0384: OMEMO Encryption

    This PR ditches trust management from the OMEMO store. The store now only stores keys and the users ratchet. By doing so, the OmemoManager can be created while the client is offline. Once it comes online, it retrieves the users BareJid for usage with the OmemoStore.

    THIS IS STILL WORK IN PROGRESS Feeback appreciated.


    • Rework integration tests
    • New structure of base integration test classes
    • bump dependency on signal-protocol-java from 2.4.0 to 2.6.2
    • Introduced CachingOmemoStore implementations
    • Use CachingOmemoStore classes in integration tests
    • Removed OmemoSession classes (replaced with more logical OmemoRatchet classes)
    • Consequently also removed load/storeOmemoSession methods from OmemoStore
    • Removed some clutter from KeyUtil classes
    • Moved trust decision related code from OmemoStore to TrustCallback
    • Require authenticated connection for many functions
    • Add async initialization function in OmemoStore
    • Refactor omemo test package (/java/org/jivesoftware/smack/omemo -> /java/org/jivesoftware/smackx)
    • Remove OmemoStore method isFreshInstallation() as well as defaultDeviceId related stuff
    • FileBasedOmemoStore: Add cleaner methods to store/load base data types (Using tryWithResource, only for future releases, once Android API gets bumped)
    • Attempt to make OmemoManager thread safe
    • new logic for getInstanceFor() deviceId determination
    • OmemoManagers encrypt methods now don't throw exceptions when encryption for some devices fails. Instead message gets encrypted when possible and more information about failures gets returned alongside the message itself
    • Added OmemoMessage class for that purpose
    • Reworked entire OmemoService class
    • Use safer logic for creating trust-ignoring messages (like ratchet-update messages)
    • Restructure elements/provider in order to prepare for OMEMO namespace bumps
    • Remove OmemoManager.regenerate() methods in favor of getInstanceFor(connection, randomDeviceId)
    • Removed some unnecessary configuration options
    • Prepare for support of more AES message key types
    • Simplify session creation
    • Where possible, avoid side effects in methods
    • Add UntrustedOmemoIdentityException
    • Add TrustState enum
    • More improved tests


    • [x] Reimplement message decryption
    • [x] Reimplement stanza listening
    • [x] Reimplement PEP listeners
    • [x] Reimplement support for MAM queries
    • [x] Reimplement some more convenience methods
    • [ ] More testing
    • [ ] Implement client side support for publish options

    • [x] Document changes
    • [ ] Create migration guide
    • [x] Rant about OMEMOs quirks
    opened by vanitasvitae 19
  • Multi-User Chat Light (v0.1.0) implementation

    Multi-User Chat Light (v0.1.0) implementation

    Multi-User Chat Light (v0.1.0) documentation: http://mongooseim.readthedocs.io/en/latest/open-extensions/xeps/xep-muc-light.html

    All modules are implemented :)

    opened by ramabit 16
  • Implementation of XEP-0308: Last Message Correction

    Implementation of XEP-0308: Last Message Correction

    Fixes SMACK-714

    Documentation: https://xmpp.org/extensions/xep-0308.html

    How to use it

    Send: message.addExtension(new MessageCorrectExtension(idInitialMessage));

    Receive: ProviderManager.addExtensionProvider(MessageCorrectExtension.ELEMENT_NAME, MessageCorrectExtension.NAMESPACE, new MessageCorrectProvider());

    MessageCorrectExtension messageCorrectExtension = MessageCorrectExtension.from(message)

    opened by ramabit 15
  • Additional Pubsub integration tests

    Additional Pubsub integration tests

    Hi @Flowdalic - this isn't ready yet (more tests to come), hence the 'draft' status on the PR. I'm primarily interested in hearing from you if you'd accept more tests along these lines (before I start spending effort only to find it in vain). Whaddayathink?

    opened by guusdk 13
  • OMEMO encryption

    OMEMO encryption

    I cleaned the code up, fixed all gradle checkstyle issues and targeted 4.2

    opened by vanitasvitae 13
  • XEP-0333 Improvement

    XEP-0333 Improvement

    In order to be able to use ChatMarkersManager following same pattern/architecture like ChatStateManager or ChatManager (version 2), some improvement needs to be done in the XEP-0333 implementation.

    The goal of this improvement was obtain an interface to be implemented like IncomingChatMessageListener or ChatStateListener. For that, an interface was created (ChatMarkersListener), an enum (ChatMarkersState) and 2 files modified (ChatMarkersElements and ChatMarkersManager). For more details, please read commits description.

    The changes done in ChatMarkersManager were done trying to mimic ChatStateManager and ChatManager.

    Those changes has been implemented successfully in an app (I can't say the name :/).

    Any suggestion is welcome.

    opened by miguelhincapie 12
  • This small hack prevent crash on Psi+ online status.

    This small hack prevent crash on Psi+ online status.

    Before this commit if roster has at least one user with Psi+ client online the smack just crash.

    Psi+ sends presence likes:

    <presence from='[user]@jabber.ru/Psi+work' to='[email protected]/34110840091527669849196298' xml:lang='ru'>
    <c xmlns='http://jabber.org/protocol/caps' node='http://psi-plus.com' ver='D7clrAb+xAPCSMydA+X+iNO94fI=' hash='sha-1'/>
    <x xmlns='vcard-temp:x:update'><photo>b5402fd5a5f7f95f74857688c7e96364d0e0a34c</photo></x><delay xmlns='urn:xmpp:delay' from='[user]@jabber.ru/Psi+work' stamp='2018-05-30T08:33:38Z'/></presence>

    when smack tried to parse it crashed with trace:

    12:44:10 XMPPConnection closed due to an exception (XMPPTCPConnection[[email protected]/34110840091527669849196298] (0))java.lang.IllegalArgumentException: No enum constant org.jivesoftware.smack.packet.Presence.Mode.online
    	at java.base/java.lang.Enum.valueOf(Enum.java:240)
    	at org.jivesoftware.smack.packet.Presence$Mode.valueOf(Presence.java:394)
    	at org.jivesoftware.smack.packet.Presence$Mode.fromString(Presence.java:431)
    	at org.jivesoftware.smack.util.PacketParserUtils.parsePresence(PacketParserUtils.java:561)
    	at org.jivesoftware.smack.util.PacketParserUtils.parseStanza(PacketParserUtils.java:155)
    	at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMPPConnection.java:1083)
    	at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$500(XMPPTCPConnection.java:151)
    	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1044)
    	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:1000)
    	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:1016)
    	at java.base/java.lang.Thread.run(Thread.java:844)
    opened by catap 11
  • [sinttest] Tweaks to the muc test javadoc

    [sinttest] Tweaks to the muc test javadoc

    • Fix 1 incorrect XEP reference
    • Add 1 XEP reference for a previously undocumented test
    opened by Fishbowler 0
  • [sinttest] Fix ordering of parameters in muc assertEquals checks

    [sinttest] Fix ordering of parameters in muc assertEquals checks

    Spotted by @Flowdalic when reviewing #468 Tested working against Openfire master

    opened by Fishbowler 0
  • Add kick presence tests

    Add kick presence tests

    Inspired by OF-2240. Used to validate the problem, then test the fix.

    Makes several assertions about the presence sent to a kicked user, and about presences sent to users "witnessing" the kick.

    opened by Fishbowler 3
  • Proposed data form updates for 4.4

    Proposed data form updates for 4.4

    Related forum post: https://discourse.igniterealtime.org/t/function-getdataformtosubmit-of-fillableform-changes-the-ordering-of-the-fields/89944/3?u=flow

    opened by Flowdalic 0
  • WIP: Additional Pubsub integration tests

    WIP: Additional Pubsub integration tests

    For XEP-0060 § 7.1.2. Asserts that publishing an item with the same ID overwrites the previous item with that ID.

    For XEP-0060 § 8.4.1: Assert that the server send a notification to subscribers when deleting a node that exists.

    Test for XEP-0060 § Asserts that the server returns an 'item-not-found' error response when deleting a node that does not exist.

    Tests for non-optional ('MUST') conditions in XEP-0060 § 6.2

    Tests for non-optional ('MUST') conditions in XEP-0060 § 6.1.6

    Tests for non-optional ('MUST') conditions in XEP-0060 § 6.1.4

    Tests for non-optional ('MUST') error conditions upon subscription (XEP-0060 § 6.1.3).

    Co-authored-by: Paul Schaub [email protected] Co-authored-by: Florian Schmaus [email protected]

    Thank you for your contribution!

    opened by Flowdalic 1
  • Initial Support for XEP-0447: Stateless File Sharing

    Initial Support for XEP-0447: Stateless File Sharing

    This PR adds initial support (elements and providers) for XEP-0447: Stateless File Sharing

    Depends on (and contains) #448 and #449

    opened by vanitasvitae 0
  • Add initial support for XEP-0103 and XEP-0104: URL Address Information

    Add initial support for XEP-0103 and XEP-0104: URL Address Information

    This PR adds initial support for XEP-0103: URL Address Information and XEP-0104: HTTP Scheme for URL Address Information.

    opened by vanitasvitae 0
  • Initial support for XEP-0446: File Metadata Element

    Initial support for XEP-0446: File Metadata Element

    Solves SMACK-894

    XEP-0446: File Metadata Element defines a generic extension element format that can be used to describe file metadata. This PR adds initial support for this protocol by implementing the element and provider classes.

    opened by vanitasvitae 0
  • Add method to remove registered CAPS listener

    Add method to remove registered CAPS listener

    ServiceDiscoveryManager allows a listener for CAPS changes to be registered. It should also allow to remove a previously registered listener.

    opened by guusdk 0
Ignite Realtime
Ignite Realtime is the community for the users and developers of open source Real Time Communications projects.
Ignite Realtime
An XMPP server licensed under the Open Source Apache License.

Openfire About Openfire is a real time collaboration (RTC) server licensed under the Open Source Apache License. It uses the only widely adopted open

Ignite Realtime 2.3k Mar 12, 2021
Java client for NATS

NATS - Java Client A Java client for the NATS messaging system. A Note on Versions This is version 2.x of the java-nats library. This version is a gro

NATS - The Cloud Native Messaging System 325 Mar 12, 2021
RabbitMQ Java client

RabbitMQ Java Client This repository contains source code of the RabbitMQ Java client. The client is maintained by the RabbitMQ team at Pivotal. Depen

RabbitMQ 964 Mar 13, 2021
Apache Pulsar - distributed pub-sub messaging system

Pulsar is a distributed pub-sub messaging platform with a very flexible messaging model and an intuitive client API. Learn more about Pulsar at https:

The Apache Software Foundation 7.4k Mar 13, 2021
A distributed event bus that implements a RESTful API abstraction on top of Kafka-like queues

Nakadi Event Broker Nakadi is a distributed event bus broker that implements a RESTful API abstraction on top of Kafka-like queues, which can be used

Zalando SE 734 Mar 5, 2021
Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.

EventBus EventBus is a publish/subscribe event bus for Android and Java. EventBus... simplifies the communication between components decouples event s

Markus Junginger 23.2k Mar 13, 2021
Efficient reliable UDP unicast, UDP multicast, and IPC message transport

Aeron Efficient reliable UDP unicast, UDP multicast, and IPC message transport. Java and C++ clients are available in this repository, and a .NET clie

Real Logic 5.4k Mar 12, 2021
Powerful event-bus optimized for high throughput in multi-threaded applications. Features: Sync and Async event publication, weak/strong references, event filtering, annotation driven

MBassador MBassador is a light-weight, high-performance event bus implementing the publish subscribe pattern. It is designed for ease of use and aims

Benjamin Diedrichsen 876 Mar 13, 2021
A JVM library to use RabbitMQ as an embedded service

Embedded RabbitMQ Compatibility: Builds: Linux OS X Windows Reports: Dist: Social: This library allows for the use of various RabbitMQ versions as if

Alejandro Rivera 81 Mar 4, 2021
Real Time communication library using Animated Gifs as a transport™

gifsockets "This library is the websockets of the '90s" - Somebody at Hacker News. This library shows how to achieve realtime text communication using

Alvaro Videla 1.7k Mar 9, 2021
Java binding for ZeroMQ

What is JZMQ? This is the Java language binding for libzmq (aka ZeroMQ, 0MQ). The latest javadocs. Building and Installing JZMQ To build you need to h

The ZeroMQ project 569 Mar 11, 2021
Mirror of Apache Kafka

Apache Kafka See our web site for details on the project. You need to have Java installed. We build and test Apache Kafka with Java 8, 11 and 15. We s

The Apache Software Foundation 18.2k Mar 13, 2021
Mirror of Apache RocketMQ

Apache RocketMQ Apache RocketMQ is a distributed messaging and streaming platform with low latency, high performance and reliability, trillion-level c

The Apache Software Foundation 13.7k Mar 13, 2021
Kryptonite is a turn-key ready transformation (SMT) for Apache Kafka® Connect to do field-level 🔒 encryption/decryption 🔓 of records. It's an UNOFFICIAL community project.

Kryptonite - An SMT for Kafka Connect Kryptonite is a turn-key ready transformation (SMT) for Apache Kafka® to do field-level encryption/decryption of

Hans-Peter Grahsl 15 Mar 22, 2021