ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Using the C# code sample remotely

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 Using the C# code sample remotely « View previous topic :: View next topic » 
Author Message
fishlips
PostPosted: Tue Jan 03, 2012 9:31 am    Post subject: Using the C# code sample remotely Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

I have successfully run the compiled C# sample "SampleConsumer.cs" on our MQ Server, and it works a treat, I can see it connect to the queue manager and download messages from the specified queue.

However, if I try to run it on a client system, it doesn't work.

Someone has told me that, in order for this to work, I need to configure a server connection (SVRCONN) channel setup.

I have no idea what this is, can anyone advise on where to start?

Thanks.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 03, 2012 9:34 am    Post subject: Re: Using the C# code sample remotely Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fishlips wrote:
I have no idea what this is, can anyone advise on where to start?


You'll find full details on configuring a client connection in the Clients manual (or matching part of the InfoCenter).

You'll also need to relink your code to use client libraires. You'll find that described in the Clients manual, and detailed infomation on the connection types in the .NET manual.

Or you could just search the InfoCenter for "SVRCONN" or "server connection".
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 03, 2012 9:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Moved to more relevant section.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 2:16 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

Ok, so I've found the clients section of Infocenter. I've got as far as the verification, but I get this error in the LOG file:

Code:
04/01/2012 09:35:51 - Process(2328.1) User(graffr-adm) Program(amqsputc.exe)
                    Host(AVN-AS-30-R)
AMQ9547: Type of remote channel not suitable for action requested.

EXPLANATION:
The operation requested cannot be performed because channel 'TAS_AMC1.AMC_EGW1'
on the remote machine is not of a suitable type.  For example, if the local
channel is defined as a sender the remote machine must define its channel as
either a receiver or requester.
ACTION:
Check that the channel name is specified correctly.  If it is, check that the
remote channel has been defined correctly.
----- cmqxrfpt.c : 457 --------------------------------------------------------


How do I define the remote machine's requester channel? I can see a section named Defining a client-connection channel using MQSERVER but I don't understand why it doesn't specify anything relating to the remote machine that is trying to make the connection. I'm imagining that I will need to tell the queue manager TAS_AMC1 to expect connections from my client AVN-AS-30-R.
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 3:44 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36



Ok, so I noticed that we'd set up a sender channel for our client, so I created a similar sender channel for my client machine. I've specified the IP address of my client machine, and the queue that I want to connect to.

Unfortunately, when I run the CS sample, I still get error 2035 (07F3) (RC2035): MQRC_NOT_AUTHORIZED.

Any idea why?

I've also tried this command:

Code:

amqsputc AMC_EGW1 TAS_AMC1


...but I get

Code:
MQCONN ended with reason code 2058


..MQRC_Q_MGR_NAME_ERROR, which seems to imply that I got the queue manager name wrong, but I'm sure that TAS_AMC1 is the name of the queue manager.

Any ideas?
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 4:03 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

The thing that perhaps I'm getting confused about, as I read the documentation, is that the manuals talk about setting up connections from local queue managers to remote queue managers, however, this isn't what I'm trying to do.

All I need to do is run the C# sample (or something similar), to read messages from the queue from a remote machine.

In case it's relevant, I am able to ping the MQ server via IP address from my client machine.
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Jan 04, 2012 4:06 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

You can only ever read messages (MQGET) from a local queue.

Messages may arrive on that local queue as a result of being put to a remote queue somewhere else.

If you are using a client connection to a "remote" QM, the queue is still local as far as MQ is concerned.
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 4:11 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

zpat wrote:
You can only ever read messages (MQGET) from a local queue.

Messages may arrive on that local queue as a result of being put to a remote queue somewhere else.

If you are using a client connection to a "remote" QM, the queue is still local as far as MQ is concerned.


Ok, so then I guess the question is, how do I set up my "local queue" on my client? Is this not what my new sender channel is doing?
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 4:13 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

Am I barking up the wrong tree by using amqsputc to verify my set up?

I ask, because amqsputc seems to imply that I'm trying to put a message on a queue. This isn't what I'm trying to do. All I need to do is read messages from a queue.
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 4:23 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

Not sure if this is relevant, but we have set up:

- 1 Queue Manager

Under queues:
- 8 x local queues
- 2 x remote queues

Under Channels:
- 2 x Receiver Channels
- 1 x Server-Connection (SVRCONN) Channel
- 2 x Sender Channels linked to Queue 1 (AMC_EGW1)
- 1 x Sender Channel linked to Queue 2 (AMC_EGW2)

One of the sender channels linked to Queue 1 is a TCP channel, linked to my client's IP address via port 1414.
Back to top
View user's profile Send private message
exerk
PostPosted: Wed Jan 04, 2012 4:27 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

You need to read the Intercommunication manual more closely, especially the section on client applications. You need to delineate more clearly what you mean by client - do you mean client applications, i.e. applications invoking WMQ client libraries, or do you mean client queue managers, i.e. queue managers receiving messages from your queue manager, or do you mean clients, i.e. business partners to whom you connect, or connect to you, via WebSphere MQ infrastructure?

SENDER\RECEIVER channels are for queue-manager-to-queue-manager communication; SVRCONN channels are for client applications.

As you have found the PUT sample, go seek and find the GET sample
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
exerk
PostPosted: Wed Jan 04, 2012 4:29 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

fishlips wrote:
...One of the sender channels linked to Queue 1 is a TCP channel, linked to my client's IP address via port 1414.

Channels do not link queues, channels link queue managers.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 4:38 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

Hi Exerk, sorry for any confusion, I definitely mean client applications, as apposed to client queue managers.

Currently, we have two channels set up which both have SVRCONN in the name. One, which already existed before today, is of channel type "Server-connection", and is running.

The other, is the sender channel that I set up earlier today, which I named "REMOTE.SVRCONN". I'm guessing that I don't need this one.

Quote:
as you have found the PUT sample, go seek and find the GET sample


Ok, well this is interesting, if I run
Code:
amqsget AMC_EGW1 TAS_AMC1


i get this error:
Code:
This application has failed to start because MQM.dll was not found. Re-installing the application may fix this problem.


If I run
Code:
amqsgetc AMC_EGW1 TAS_AMC1


I get this error:
Code:
Sample AMQSGET0 start
MQCONN ended with reason code 2058


So, to clarify, we do have a Server-Connection channel set up, and it is running. Is there something else I need to do, in order to allow my client application to connect?
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Jan 04, 2012 4:38 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

If by client, you mean MQ client - these don't hold queues.
Back to top
View user's profile Send private message
fishlips
PostPosted: Wed Jan 04, 2012 4:39 am    Post subject: Reply with quote

Apprentice

Joined: 21 Dec 2011
Posts: 36

exerk wrote:
fishlips wrote:
...One of the sender channels linked to Queue 1 is a TCP channel, linked to my client's IP address via port 1414.

Channels do not link queues, channels link queue managers.


I see now that this is wrong, so I will delete this channel.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » General IBM MQ Support » Using the C# code sample remotely
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.