Shared memory across docker containers

2020-05-04 06:09发布

If Websphere MQ is used as a XA(Distributed Transaction) Transaction Manager using Java MQ classes, not JTA, the Java application and the WMQ, both need to reside on the same host machine. I have been told this is because shared memory is used as Inter Process Communication mechanism. The Java application and the Websphere MQ both need access to shared memory to make XA work.

If we deploy WMQ in a docker container and keep our Java application in another docker container, both on the same host, will we be able to use the WMQ as a XA coordinator?

Will we have to use certain special configuration of the container to get it working? Can we allow the two containers to use common shared memory?

Regards,
Yash

标签: docker ibm-mq
1条回答
戒情不戒烟
2楼-- · 2020-05-04 06:40

You can use common IPC name spaces via the --ipc option for run and create

docker run -d --name=wmq wmq
docker run -d --ipc=container:wmq app

Or a less secure host ipc

docker run -d --ipc=host wmq
docker run -d --ipc=host app

I'm not sure of MQ's explicit support for either setup for XA but IBM do support MQ in Docker.

查看更多
登录 后发表回答