I/m trying to connect remote queue manager from my Java code.
I have host name, port number, channel, Queue manager name and queue name to connect the remote mq.
So my questions is...
Do we need to create a new queue manager and queue in local and then do Java configuration in code to connect remote mq?
I see MQSample.java has no local queue creation code, which was provided by IBM websphere mq.
When i try to access the host and port using telnet...it works showing blank cmd and. So I guess no connection problem to that remote host.
Please show some examples to connect remote mq using Java. I tried looking IBM MQ tutorial also.
Related
Currently Microfocus server and IBM MQ are hosted in different servers and linked by MQSERVER environmental variable in Microfocus.
What configuration need to be changed in Microfocus to connect to IBM MQ hosted on same server?
I tried changing the MQSERVER variable to new server details, but it failed due to 2538 unable to find mq host.
Assuming that your code does not provide any of the connection details, which given you are using MQSERVER environment variable, suggests it does not; then you can switch from a client connection to a local bindings connection by:-
Removing the MQSERVER environment variable
(Optionally) setting the MQ_CONNECT_TYPE environment variable to LOCAL
I want to access queue manager via mq explorer but getting an error:
Could not establish a connection to the queue manager - reason 2538. (AMQ4059)
Could not establish a connection to the queue manager - reason 2538. (AMQ4059)
Severity: 10 (Warning)
Explanation: The attempt to connect to the queue manager failed. This could be because the queue manager is incorrectly configured to allow a connection from this system, or the connection has been broken.
Response: Try the operation again. If the error persists, examine the problem determination information to see if any information has been recorded.
I followed all the instructions in https://www-01.ibm.com/support/docview.wss?uid=swg21623113 in order to allow mq explorer to be able to access mq server but still no luck.
IBM MQ Server details:
Version: 8
OS: Centos
Running in a docker container
Using port 1417 since my 1414 port is not available for another MQ server
Listener is up an running and pointing port 1417
Channel is defined as it is described in the link that I shared (I disabled all security features as it is described)
I have a sample Java App that I can put/get messages and it is working fine
MQ Explorer details:
Also running in another docker container thanks to
https://github.com/ibm-messaging/mq-container/tree/master/incubating/mq-explorer
I can telnet MQ Server from xterm so there is no issue about the connectivity
Although I disabled all security features, I also tried to create the same username on server as well as my xterm but it did not work either.
I was expecting to get an error message in my MQ Server to understand the issue but surprisingly there is no error message at all ...
Screenshot
You've stated that your queue manager(s) are running in a container and your MQ Explorer is running in another container. I've noticed you've supplied 0.0.0.0 as your hostname but the container where MQ Explorer is running has no queue managers running on it!
If you run the following command (replacing with the ID of the container running your queue managers) you should get the IP address of the container on the docker subnet. Try using that IP address in MQ Explorer instead of 0.0.0.0:
docker inspect --format "{{ .NetworkSettings.IPAddress }}" <QM container>
If your container is on a different docker network then you will need to run the following replacing with the name you gave the docker network:
docker inspect --format "{{ .NetworkSettings.Networks.<Network Name>.IPAddress }}" <QM container>
Additionally, when you created your queue manager container did you remember to expose the 1417 port you are trying to use? By default the mq-container sample only exposes the following ports: 1414, 9157 & 9443. When you ran the container you would of needed to expose the ports but supplying --publish-all --publish 1417 when you ran the container. For example:
docker run -d -e LICENSE=accept --publish-all --publish 1417 ibmcom/mq
You have attempted to connect your MQ Explorer to your queue manager using the following connection details:-
Host name or IP address: 0.0.0.0
Port number: 1417
Server-connection channel: SYSTEM.ADMIN.SVRCONN
and you have received return code MQRC_HOST_NOT_AVAILABLE(2358) which says that the network address is not reachable.
Common reasons for this error include not having a TCP.IP listener running using that port, but you have told us you have got a listener running.
The IP address you have used is the problem. Change the IP address in your MQ Explorer configuration to the actual IP address where the queue manager is running. If the MQ Explorer and Queue Manager are on the same machine (in the same container), you can use the localhost hostname or the IP address 127.0.0.1, otherwise, please use the assigned IP address for the machine. From your screenshot it appears that this might be a 192.168.* address.
You don't say what version of IBM MQ your queue manager is running under. i.e. v7.5, v8.0, v9.0 or v9.1.
Did you give yourself CHLAUTH permission to use the SYSTEM.ADMIN.SVRCONN channel? Most likely you are being blocked by the backstop rule.
Also, if you are on IBM MQ v8.0 or higher then then CONNAUTH could be blocking you.
Here are 2 good links to walk you through your issue.
https://www.ibm.com/developerworks/community/blogs/aimsupport/entry/blocked_by_chlauth_why?lang=en
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.mig.doc/q001110_.htm
Similar questions have been asked
RabbitMQ on Amazon EC2 Instance & Locally?
and
cant connect from my desktop to rabbitmq on ec2
But they get different error messages.
I have a RabbitMQ server running on my linux EC2 instance which is set up correctly. I have created custom users and given them permissions to read/write to queues. Using a local client I am able to correctly receive messages. I have set up the security groups on EC2 so that ports (5672/25672) are open and can telnet to those ports. I also have set up rabbitmq.conf like this.
[
{rabbit, [
{tcp_listeners, [{"0.0.0.0",5672}]},
{loopback_users, []},
{log_levels, [{connection, info}]}
]
}
].
At the moment I have a client on the server publishing to the queue.
I have another client running on a server outside of EC2 which needs to consume data from the same queue (I can't run both on EC2 as the consume does a lot of plotting/graphical manipulation).
When I try to connect however from the external client using some test code
try {
ConnectionFactory factory = new ConnectionFactory();
factory.setUri("amqp://****:****#****:5672/");
connection = factory.newConnection();
} catch (IOException e) {
e.printStackTrace();
}
I get the following error.
com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED -
Login was refused using authentication mechanism PLAIN. For details
see the broker logfile.
However there is nothing in the broker logfile as if I never tried to connect.
I've tried connecting using the individual getter/setter methods of factory, I've tried using different ports (along with opening them up).
I was wondering if I need to use SSL or not to connect to EC2 but from reading around the web it seems like it should just work but I'm not exactly sure. I cannot find any examples of people successfully achieving what I'm trying to do and documenting it.
Thanks in advance
The answer was simply that I needed to specify the host to be the same IP I use to SSH into. I was trying to use the Elastic IP/public dns of the instance of the EC2 instance which I thought should point to the same machine.
Although I did try many things including setting up an SSL connection it was not necessary.
All that is needed is:
Create rabbitmq user using rabbitmqctrl and give it appropriate permissions
Open the needed ports on EC2 via Security Groups menu (default is 5672)
Use client library to connect to correct host name/username/password/port where the host name is the same as the machine that you normally SSH into.
Issue Trying to start the IBM websphere server when i am connected to the VPN network.
I cannot start my application in WebSphere Application server when connected over the VPN( I have all required host entries). Logs suggest that the ATG repositories failed to start over the VPN Network ( some problem with the connection timeout in datasources in the application)
I am able to connect to the Datasources without any issues using other tools like Sql Developer etc.
Can someone please explain why this is happening only over the VPN network but not when i am connected to the local Intranet network.
I have a websphere application server environment running on a remote linux machine, with multiple appserver instances running. I want to use a tool like jconsole or visualvm on my local desktop to monitor the heap size of the individual appservers, but have no idea how to do it. The solutions found after googling do not tell how to enable multiple connections to individual appserver instances. Any help please ?
You need to enable JMX connection for every app server instance. Once you did it, add remote JMX connection to those servers in VisualVM.