How to communicate from SAP to Message queue?

Yes, you can do what you are aspiring for. But it depends upon your actual requirement. Let’s say you need to execute the some custom application or program in SAP, then you can opt for any available connector which reads a file or else. This connector then later establishes a connection to the queue and then sends a message.

Let’s say you cannot keep polling for files availability, and then you need to use the remote function call methodology. RFC has a SDK available and its online support is tremendous. You can use it too for sending a message.