Forum Stats

  • 3,836,734 Users
  • 2,262,175 Discussions
  • 7,900,088 Comments

Discussions

Method to Accommodate Invalid Payload from Oracle Messaging Gateway ?

Joe Upshaw
Joe Upshaw Member Posts: 968 Silver Badge
edited Mar 2, 2016 9:22AM in Advanced Queueing

DB 11.2.0.4

We have the Oracle Messaging Gateway (OMG) setup and configured to interact with an upstream IBM MQSeries topic. The Advanced Queue into which the MQ messages are forwarded has a defined payload type of JMS MAP Message. Generally, this is all working just fine.

However, the management of, and the entries within, the MQSeries queue is handled by a separate group and, therefore, to us, is basically a black box. Every once in awhile, someone on the other end will stick a message onto the MQSeries side that is of an incompatible type to that of the mapped AQ. For example, they might enqueue a "Im a Test...Ignore Me!" text message. Oh, if only that were possible!

Instead of ignoring it, however; whenever the OMG tries to forward a message with an incompatible payload type, the gateway crashes and, as one would expect, in the log we get a message similar to the following:

  • oracle.jms.AQjmsException: JMS-108: Messages of type TextMessage not allowed with Destinations containing payload of type SYS.AQ$_JMS_MAP_MESSAGE

Moreover, since the dequeue operation from MQ is not acknowledged until the enqueue operation into AQ has succeeded, the offending message can never be removed by the gateway. So; each time it starts, as soon as it encounters the offending message, it crashes again.

So far, the only fix we've ever found was to have someone from this other group (painstakingly!) track down the offending message and delete it.

My question is this: Is there any sort of "Defensive Coding" that could be employed on the Oracle side to get past these offending message, e.g. dequeue and discard? Any sort of Message Gateway parameter that we could set?

Thanks,

-Joe

Answers

  • WGabriel
    WGabriel Member Posts: 202 Bronze Badge
    edited Feb 18, 2016 2:56AM

    Hello,

    can you show your AQ setup including the definition of your AQ payload type?

    Do you use a special transformation from AQ payload type to the OMG payload type

    (see Oracle Messaging Gateway Message Conversion)? It sounds like a payload type mismatch.

    Kind reagards,

    WoG

  • Joe Upshaw
    Joe Upshaw Member Posts: 968 Silver Badge
    edited Feb 22, 2016 2:33PM

    Gabriel,

    Yes, it is certainly a type mismatch. We know for absolute certain that this is the cause. The question I am asking here is:

    Given a situation in which someone on the non-Oracle queue may insert a message with an incompatible type, is there any way to keep it from crashing the gateway?

    For example, is there some sort of parameter such that it could simply discard such messages?

    Thanks,

    -Joe

  • WGabriel
    WGabriel Member Posts: 202 Bronze Badge
    edited Feb 23, 2016 10:09AM

    Hello,

    so you have an application with a non-Oracle queue, which put data on a MQ system. Then OMG transfers the data to an AQ system.

    Your non-Oracle queue sometimes deliver data with a wrong payload type. If possible, the best thing would be (of course) to check the payload type

    before an enqueue and setup a corresponding exception handling. This is no option?

    Kind regards,

    WoG

  • Joe Upshaw
    Joe Upshaw Member Posts: 968 Silver Badge
    edited Feb 25, 2016 12:33PM

    Well, that is basically, the substance of my question. *How* can we check the payload type before an enqueue? As it stands now, we are simply configuring the gateway, i.e. MQ host to connect to, AQ into which to forward. We are not aware of a way to perform pre-checks on messages that arrive on the gateway.

    Do you know how to do this?

    Thanks,

    -Joe

  • WGabriel
    WGabriel Member Posts: 202 Bronze Badge
    edited Mar 1, 2016 3:09AM

    Hello,

    you did not specify how the data will be enqueued in the Non-Oracle queue by your application (using Java code, PL/SQL code etc.).

    In both source codes you will have a data type declaration for your payload objects (e.g. string/VARCHAR2, CLOB or XMLTYPE). There, it should

    be checked automatically, if there are data type differences. Otherwise there should be a try/catch block or an exception.

    Kind regards,

    WoG

  • Joe Upshaw
    Joe Upshaw Member Posts: 968 Silver Badge
    edited Mar 1, 2016 8:56AM

    That's just it, Gabriel. Our application does *not* enqueue the data. It is a completely separate system which, as I've mentioned, is a black box to us. Believe me, we are very aware that if they didn't put the wrong payload in upstream there would be no problem. The only question we are trying to get answered here is:

    Given that a wrong payload type has been enqueued into MQ, is there anyway to prevent this message from crashing the gateway?

    If the answer is no, then it is no.

    Thanks,

    -Joe

  • WGabriel
    WGabriel Member Posts: 202 Bronze Badge
    edited Mar 2, 2016 9:17AM

    Hello,

    as you wrote your application, which performs the enqueue with a wrong payload type, is a black box, I see no chance to prevent

    the MQ from a crash (perhaps the IBM documentation says anything about it).

    Kind regards,

    WoG

  • Joe Upshaw
    Joe Upshaw Member Posts: 968 Silver Badge
    edited Mar 2, 2016 9:22AM

    WoG,

    I figured this was the case but, just wanted to reach out to the community in case there was some feature about which I was unaware.

    For what it's worth, I've also opened a case with Oracle support. I'll leave this thread open a bit longer in case they come back with something useful. In the unlikely event that they do, I'll post the resolution here.

    Thanks, sincerely, for all of your efforts though.

    Cheers,

    -Joe

This discussion has been closed.