I'm currently trying to connect a java application (running on premise) to the SAP event mesh to receive messages published by some SAP system.
The colleagues provided a json file with credentials and endpoints:
{
"namespace": ":)",
"xsappname": ":)",
"management": [
{
"oa2": {
"clientid": ":)",
"clientsecret": ":)",
"tokenendpoint": "https://whatever.authentication.eu20.hana.ondemand.com/oauth/token",
"granttype": "client_credentials"
},
"uri": "https://em-hub-backend.cfapps.eu20.hana.ondemand.com"
}
],
"serviceinstanceid": ":)",
"messaging": [
{
"oa2": {
"clientid": ":)",
"clientsecret": ":)",
"tokenendpoint": "https://whatever.authentication.eu20.hana.ondemand.com/oauth/token",
"granttype": "client_credentials"
},
"protocol": [
"amqp10ws"
],
"broker": {
"type": "sapmgw"
},
"uri": "wss://em-messaging-gateway.cfapps.eu20.hana.ondemand.com/protocols/amqp10ws"
},
{
"oa2": {
"clientid": ":)",
"clientsecret": ":)",
"tokenendpoint": "https://whatever.authentication.eu20.hana.ondemand.com/oauth/token",
"granttype": "client_credentials"
},
"protocol": [
"mqtt311ws"
],
"broker": {
"type": "sapmgw"
},
"uri": "wss://em-messaging-gateway.cfapps.eu20.hana.ondemand.com/protocols/mqtt311ws"
},
{
"oa2": {
"clientid": ":)",
"clientsecret": ":)",
"tokenendpoint": "https://whatever.authentication.eu20.hana.ondemand.com/oauth/token",
"granttype": "client_credentials"
},
"protocol": [
"httprest"
],
"broker": {
"type": "saprestmgw"
},
"uri": "https://em-pubsub.cfapps.eu20.hana.ondemand.com"
}
]
}
According to the SAP help page there are 3 supported protocols (https://help.sap.com/viewer/bf82e6b26456494cbdd197057c09979f/Cloud/en-US/3f424ff1ae3b4bc084c4f1ea0be96f54.html)
- Advanced Message Queuing Protocol (AMQP) 1.0 over WebSocket
- Message Queuing Telemetry Transport (MQTT) 3.1.1 over WebSocket
- REST APIs for Messaging
I guess REST APIs have very bad performance. So I'd go for AMQP or MQTT over WS. It's a bit hard to find a java client library that supports either AMQP or MQTT and secure websockets and oauth authentication.
I already had a look at SAP cloud sdk. But the feature overview tells me that messaging is still in planned state which means it's not available yet.
Do you have any suggestions how I can make progress here?