MQSeries 2045: MQRC_OPTION_NOT_VALID_FOR_TYPE

While doing some work with MQSeries, I got an error “MQJE001: Completion Code 2, Reason 2045” in MQQueueManager.accessQueue() which translates to “MQRC_OPTION_NOT_VALID_FOR_TYPE”. Hm. Hey, IBM, how about adding real error messages to your products instead of having people look up odd codes in tables?

Anyway, the error means that I’m trying to open a queue for output which doesn’t support this. For example, remote queues can be opened with the option MQC.MQOO_OUTPUT but not with MQOO_BROWSE or MQOO_INPUT_AS_Q_DEF. Other queues don’t allow to read from them, i.e. you have to get rid of MQC.MQOO_INPUT_AS_Q_DEF in the openOptions.

See this page for all possible combinations: MQOPEN – Open object

2 Responses to MQSeries 2045: MQRC_OPTION_NOT_VALID_FOR_TYPE

  1. Sri says:

    It is quit opposit. Remotes queus open with MQOO_OUTPUT. But not withMQOO_INPUT_AS_Q_DEF

    • digulla says:

      Good catch. I’ve fixed the post and added a link to the documentation page which contains a table which option/queue type combination is valid.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: