Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7399635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:05:10+00:00 2026-05-29T04:05:10+00:00

we have WebSphere MQ server. I have written Java client utility which can read

  • 0

we have WebSphere MQ server.
I have written Java client utility which can read all messages (leaving them in queue) or delete all from queue.
But is that possible to read message and if it contains certain string – delete it?

To read queue message i use (message will stay on server queue for future processing, coz utility only for testing):

MQQueue queue = queueManager.accessQueue(queueName, MQC.MQ00_BROWSE | MQC.MQ00_INPUT_SHARED);
MQGetMessageOptions options = new MQGetMessageOptions();
options.options = MQC.MQ00_BROWSE_FIRST | MQC.MQ00_INPUT_SHARED;
while(true) {
MQMessage msg = new MQMessage();
queue.get(msg, options);
if (msg.getTotalMeesageLength() == 0) {
break;
} else {
readMessage(msg);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:05:11+00:00Added an answer on May 29, 2026 at 4:05 am

    This is actually a fairly common requirement. The methodology is to browse through the messages looking for the one you want to delete. When you find it, delete it with a destructive GET. You can GET the message using the browse cursor as described in the Infocenter here. You can also use a separate thread with it’s own queue handle to GET using the MsgID that you obtained from the browse. Simply call the other thread and pass it the MsgID. The simplest way is to use one thread and the browse cursor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a hudson build server (Windows) that does not have Websphere installed. I
I have an application running on Websphere Application Server 6.0 and it crashes nearly
I have a JavaEE 1.4 web application running on WebSphere Application Server 6.0. In
I have a J2EE application running on an IBM Websphere Application Server on a
I have downloaded the Websphere 2.1 App Server and verified that it works fine.
I have recently upgraded from websphere 5.1.2 to websphere 6.1 server. I had some
I am using IBM Websphere Application Server v6 and Java 1.4 and am trying
We have couple of portlets deployed on Websphere Portal Server. In the css file
I have a Websphere Portal application containing several portlets for which I'm currently working
I have two separate installs of WebSphere. (Actually one is WebSphere Application Server V6.1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.