Take a look at the community commons module executeMicroflowAsUser action. I think you find here what you are looking for.
I have struggled with something similar. I ended up returning an object from the Java action and let the microflow that calls the Java action do the display message. Maybe that could work for you too. You could also return a boolean or pass an object as parameter and change it in the Java code. Non-persistent entities can be a great help with these situations.
The problem is probably that the showmessage only works in the same context as the current user. If you loose that context or run in a system context the message will not be displayed in the browser.
You can try notify widget from the appstore to achieve this.
Please check the API, there you will find a method, like addFromFeedback (something like that). may be that will helps.
There is another way to do about it... Create a microflow, which will open a page( may be a blank one..)show the message. Call that microflow from the java action.
Hope this helps!