The Ignite Realtime developer community is happy to announce that Smack 4.5 entered its beta phase. Smack is a XMPP client API written in Java that is able to run on Java SE and Android. Smack’s beta phase started already a few weeks ago, but 4.5.0-beta5 is considered to be a good candidate to announce, as many smaller issues have been ironed out.
With Smack 4.5 we bumped the minimum Java version to 11. Furthermore Smack now requires a minimum Android API of 26 to run.
If you are using Smack 4.4 (or maybe an even older version), then right now is the perfect time to create an experimental branch with Smack 4.5 to ease the transition.
Smack 4.5 APIs is considered stable, however small adjustments are still possible during the beta phase.
Hi Allen. Smack is a Java library. As such, there are no platform-specific builds. It is pretty much a one-size-fits-all build. Downloads can be obtained from Maven repositories, such as the one linked here: Maven Central Repository Search
Note that around Smack 4.5.0-beta3, support for Java 8 was dropped. As a result, the Maven coordinates for one of the commonly used artifacts changed from:
org.igniterealtime.smack:smack-java8-full
to: org.igniterealtime.smack:smack-java11-full
That can add some confusion (I know it did for me once or twice!)
Thanks for the feedback. I figured out what we needed to do to hook into the Maven repo for java11.
I now have another question, and I believe I know what the answer will be. We have a customization to the XMPP server we use that looks for specific HTTP headers for authentication information. I assume that the the HTTP connection for the Websockets connection is established within the Smack code, and therefore, we do not have direct access to specify any attributes for that HTTP connection, like setting headers for the HTTP connection.
Is my assumption correct? If so, I also assume that getting a modification to Smack to be able to set headers on the HTTP connection used for the WebSocket connection is probably not something that would be possible in the near future, correct?
I’m going out of my comfort zone here, but by looking at both the Java11 and OkHttp-based websocket implementations, I can’t spot a mechanism in either where custom headers can be supplied. I’m guessing that such a feature does not exist (If such a feature is desirable to have in Smack in the first place, from an architectural point of view, is a matter above my paygrade).
I think it’s kind of easy to hack some kind of hardcoded header value in, if you were to build your own fork of Smack, but I’m assuming that you’ll need more flexibility than just having a hardcoded value.
If this is a pressing matter, you may want to consider enlisting one of our commercial service providers to see if they can get this fixed for you in a timely manner. Florian Schmaus (@Flow) that is Smack’s project lead is on that list.