|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with C# Channel API Exit for Receive data |
« View previous topic :: View next topic » |
Author |
Message
|
lapastina |
Posted: Sun Dec 16, 2007 6:22 pm Post subject: Problem with C# Channel API Exit for Receive data |
|
|
Newbie
Joined: 16 Dec 2007 Posts: 3
|
Hi,
This is my first question on this forum, and my English is not very well. Sorry!!
I have a problem with an test with an API Exit in MQ 6.0 with fix 6.0.2.2.
This is my code:
using System;
using System.Text;
using System.Diagnostics;
using IBM.WMQ;
namespace MQExitReceiveChannel
{
public class MQExitsReceive : MQChannelExit, MQReceiveExit, IMQExitsReceive
{
private ASCIIEncoding ascii = null;
public byte[] ReceiveExit(MQChannelExit channelExitParms, MQChannelDefinition channelDefinition, byte[] dataBuffer, ref int dataOffset, ref int dataLength, ref int dataMaxLength)
{
LogaEvento("Buffer: " + ascii.GetString(dataBuffer), "MQExitsReceive", EventLogEntryType.Warning, true);
return dataBuffer;
}
public void LogaEvento(string Msg, string Source, EventLogEntryType Type, bool boolLog)
{
if (boolLog)
{
System.Diagnostics.EventLog.WriteEntry(Source, Msg, Type);
}
}
}
}
An the configuration in page o Exits in my Receiver Channel is:
MQExitReceiveChannel(MQExitReceiveChannel.MQExitsReceive)
When I try to start a Sender channel that connects with my Receiver channel MQ returns an error:
User exit not valid.
Channel program 'C12345678.SIMULA.1' ended because user exit 'MQExitReceiveChannel(MQExitReceiveChannel.MQExitsReceive)' is not valid.
Ensure that the user exit is specified correctly in the channel definition, and that the user exit program is correct and available.
Please, help me if as possible!
Thanks.
Leandro |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Dec 16, 2007 6:44 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think you can only write API exits in C, and not in C#.
(These are much further apart than Microsoft wants you to think they are...)
You might be able to manage C++, but the runtime bindings might cause some difficulties... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
David.Partridge |
Posted: Mon Dec 17, 2007 1:44 am Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
Usage of C++ in channel exits and in the API exit isn't officially supported. C is of course OK, as is assembler on 390 systems.
On MVS (z/OS), your usage of C is officially constrained to the SPC environment. It is possible, with some care, to use assembler code to set up a persistent C (non-SPC) environment, but this is outside the supported envelope.
C++ can be used with some restrictions (which you'll need to find out the hard way) in channel exits and API exits, but definitely falls into the category of "use at your own risk".
Unless you are highly knowledgeable about how C++ does its stuff and also somewhat of a C++ language lawyer, and have lots of experience with MQ exits in C (or assembler), I'd strongly suggest that you restrict your experiments with exits to the C language on the distributed platforms.
C# is, in my opinion, a step too far.
The usual warnings about exits being "an advanced topic" and to torture test your exits in play-pen environment apply of course. _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
tleichen |
Posted: Mon Dec 17, 2007 7:42 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
Since DotNet is another shell that C# runs under, I dare say that, even if it would be possible, it would be foolish and inefficient to write exit code in C#.  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Dec 17, 2007 8:23 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
In one of the manuals, (APG ??) you will read that 'CLNTCONN' is the ONLY type of channel that an send/receive/security exit can be written in C#. The same principles apply to Java.
If you require an exit for a Receiver channel then you need to follow the guidelines/information given above.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
lapastina |
Posted: Mon Dec 17, 2007 3:24 pm Post subject: IBM Documents |
|
|
Newbie
Joined: 16 Dec 2007 Posts: 3
|
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 17, 2007 3:36 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
lapastina |
Posted: Tue Dec 18, 2007 3:16 pm Post subject: |
|
|
Newbie
Joined: 16 Dec 2007 Posts: 3
|
Oh!
Sorry, but my english is not good! And I don´t read this help complete.
Thank you! |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|