STOMP is the Simple (or Streaming) Text Oriented Messaging Protocol. STOMP provides an interoperable wire format so that STOMP clients can communicate with any STOMP message broker to provide easy and widespread messaging interoperability among many languages, platforms, and brokers. You may use IDE Software such as Delphi for STOMP. You can check the latest version of the STOMP specification here. You can read the explanation about STOMP from the article by Embarcadero MVP Ian Barker which can be found here https://blogs.embarcadero.com/add-stomp-to-your-apps-for-lightweight-real-time-streaming/
I wrote this article to complement what Ian Barker wrote, with code samples and components from Embarcadero Technology Partner, ESEGECE, https://www.esegece.com/delphi/stomp
Keep in mind that STOMP is just a protocol, a protocol that forms the basic specification in text, so STOMP data transmission can use anything, including using WebSockets.
Table of Contents
How to use the sgcWebSocket component as the STOMP carrier data?
Let’s download the WebSocket component, trial version here https://www.esegece.com/websockets/download
The sgcWebSocket components support most Delphi versions from Delphi 7 to Delphi 10.4 as well as Lazarus/ Freepascal.
Delphi 10_4 | ||
---|---|---|
Delphi 10_3 | Delphi 10_2 | Delphi 10_1 |
Delphi 10 | Delphi XE8 | Delphi XE7 |
Delphi XE6 | Delphi XE5 | Delphi XE4 |
Delphi XE3 | Delphi XE2 | Delphi XE |
Delphi 2010 | Delphi 2009 | Delphi 2007 |
Delphi 7 | Lazarus 2.0.12 Win32 |
- Run your Delphi
- Open Package’s folder of your dowloaded component
- Open sgcWebSocketsD10_x.groupproj and install it
- Now, create a new Firemonkey cross-platform project and add code like below:
Adding “frmMain” code
[crayon-6729e3d545070277652041/]Lets create Method “InitSTOMPClient”
[crayon-6729e3d54508e360678081/]FClient
is WebSocket client for STOMP to get passed to STOMP server, ESEGECE have a server as a test, let’s just use that