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 » needed some samples connected with dead-letter queue...

Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next
 needed some samples connected with dead-letter queue... « View previous topic :: View next topic » 
Author Message
Vitor
PostPosted: Sun Aug 12, 2007 3:15 pm    Post subject: Reply with quote

Grand High Poobah

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

patryx wrote:
I have to browse all messages in dead-letter queue and show information about it and in the program there should be an option to delete all of the messages or only some of them (after browsing I could choose which one/ones...)...


This does should rather like you're reinventing a wheel. I'm also slightly concerned that you feel you'll have enough messages in the DLQ that you'll need a graphical interface to manage them; the DLQ should be used as a last resort.

patryx wrote:

and I don't know how to browse all messages (how should it look like, which options of get to set etc) and the biggest problem how to find again in the dead-letter queue the messages which after browsing I decided to delete...?


The APG & APR both cover these points. There are also a multiude of samples both with the product and on the web which you can use as a basis.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Aug 12, 2007 4:52 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Really, if you're not into automatic statistics, there is no need to write any program for this task. Get support pack MO71 and create a few extra queues for handling the messages...

MO71 will allow you to have a look at the messages. The DLQ handler will then allow zou to move messages according to their original destination to a queue of your choice. You can then inspect them there. Support pack IH03 (RFHUTIL) might help. If you kept the DLQ header you can use the DLQ handler on this resolution queue to resubmit the messages....

So as you see all the tools exist and are present....

But go ahead and have fun...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
patryx
PostPosted: Sun Aug 12, 2007 9:08 pm    Post subject: Reply with quote

Novice

Joined: 07 Aug 2007
Posts: 12
Location: Poland

But it's not my idea to create such program...it's just my task in new job to create it so that;s why I don;t think if I can use DLQ handler because I need program in C++ under Linux. So I still don't know answers to my questions...so you don't know hot to do it, do you?
_________________
Patryx
Back to top
View user's profile Send private message MSN Messenger
Vitor
PostPosted: Mon Aug 13, 2007 12:06 am    Post subject: Reply with quote

Grand High Poobah

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

patryx wrote:
So I still don't know answers to my questions...so you don't know hot to do it, do you?


We certainly don't know why you're trying to do it; you've been offered a number of much better alternatives but if your mind's made up that's fine - it's your system and your requirement.

As to how to do it if you're going to do it, both fjb_saper and I have suggested what is probably the best method of doing this. If that's not suitible for you then design something you like better, using the APG, APR & samples as suggested and good fortune in your efforts. Very few IT problems have a single solution.

And if by "it's not my idea to create such a program...it's just my task in new job" you mean you're being compelled down this path then a) push back and ask why you're being asked to do this rather odd thing & b) request sufficient training to enable you to do it. Management need to be handled firmly sometimes.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
patryx
PostPosted: Mon Aug 13, 2007 2:43 am    Post subject: Reply with quote

Novice

Joined: 07 Aug 2007
Posts: 12
Location: Poland

I know that there are other more suffient ways to reach my target. I have some programs to view messages in queue but my task is to make a program in C++ doing sth like this. My job is sth like a practice (required by my university) so maybe that's why I have to do such odd things, just to check me...In documentation there aren't clear answers to this questions ... Do you have any programs which browse messages and show a raport about information in it (I have only the sample in documentation: Using C++, no samples codes in application's folder!) ?
All messages in queue have to have ImqDeadLetterHeader and how to read it and data connecting with this header? (I CAN'T find these answers in doc.)...

/I hope you tell me sth else than I'm stupid and wasting time to do it because we're still talking about them.../
_________________
Patryx
Back to top
View user's profile Send private message MSN Messenger
Vitor
PostPosted: Mon Aug 13, 2007 2:52 am    Post subject: Reply with quote

Grand High Poobah

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

patryx wrote:
My job is sth like a practice (required by my university) so maybe that's why I have to do such odd things, just to check me


Fair enough, but we're not a training resource.

patryx wrote:
In documentation there aren't clear answers to this questions


Yes there are & you've been referred to them

patryx wrote:
Do you have any programs which browse messages and show a raport about information in it (I have only the sample in documentation: Using C++, no samples codes in application's folder!) ?


Yes I have and so do you. The IBM site has a large number of samples, there are also links in this forum to other sites containing code.

patryx wrote:
All messages in queue have to have ImqDeadLetterHeader and how to read it and data connecting with this header? (I CAN'T find these answers in doc.)


The format & use of the Dead Letter Header is specifically referenced in the APG & APR; the method you name is likewise described in the Using C++ manual. It's not concealed someplace but has it's own section you'll find via the table of contents.

patryx wrote:
/I hope you tell me sth else than I'm stupid and wasting
time to do it because we're still talking about them.../


The only waste of time is that you could have found the answers you need 5 times over in the time you've spent posting. Researching things, trying things (especially things that don't work) and refining them is not a waste of time per se but a useful way of gaining expereince.

I'd still push for formal training if I was in your position. Stupidity is not an issue here, lack of training & guidance is. This forum is not an appropriate mentoring resource.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
patryx
PostPosted: Mon Aug 13, 2007 5:22 am    Post subject: Reply with quote

Novice

Joined: 07 Aug 2007
Posts: 12
Location: Poland

Ok, Ok...thanks for answering...
_________________
Patryx
Back to top
View user's profile Send private message MSN Messenger
patryx
PostPosted: Thu Aug 16, 2007 3:06 am    Post subject: Reply with quote

Novice

Joined: 07 Aug 2007
Posts: 12
Location: Poland

I have a problem...I just want to write item (imqdeadletterheader) into messages pmsg and the to read it...this is a fragment of my code:


Code:



ImqMessage * pmsg = new ImqMessage ;
ImqDeadLetterHeader header2 ; // Dead-letter header information.


// Set up the dead-letter header information.
header2.setDestinationQueueManagerName( manager.name( ) );
header2.setDestinationQueueName( "LOL" );
header2.setPutApplicationName( "aplikacja" );
header2.setPutApplicationType( );
header2.setPutDate( /* TODAY */ );
header2.setPutTime( /* NOW */ );
header2.setDeadLetterReasonCode( MQRC_STRUC_ID_ERROR );


pmsg -> setMessageId( );
pmsg -> setCorrelationId( );

if (pmsg -> writeItem( header2 ))
{
   cout << "Loaded!" << endl;
}
 else {
    cout << "ImqMessage::Load failed, reason code = " << pmsg -> reasonCode( ) << endl;
 }



ImqDeadLetterHeader h;

if (pmsg -> readItem(h))
{
   cout << " dest name" << h.destinationQueueName() << endl;
   
}
else
   {
   cout << "ImqMessage::Read failed, reason code = " << pmsg -> reasonCode( ) << endl;
   
   }



There is no problem with writeItem, but I couldn't read anything! I can see a reason code (my screen):


Quote:


Loaded!
ImqMessage::Read failed, reason code = 6107




I checked the reason code 6107:

Quote:

6107 X’17DB’ MQRC_STRUC_ID_ERROR
The structure id for the (next) message item, which is derived from the 4 characters beginning
at the data pointer, is either missing or is inconsistent with the class of object into which the
item is being pasted.
This reason code occurs in the WebSphere MQ C++ environment.


But I have no idea what's going on...does sb know how to fix it to be able to read item (here imqdeadletterrheader)?...
_________________
Patryx
Back to top
View user's profile Send private message MSN Messenger
Vitor
PostPosted: Thu Aug 16, 2007 3:16 am    Post subject: Reply with quote

Grand High Poobah

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

So you set the reason code to MQRC_STRUC_ID_ERROR, read it back, get a 6107 reason code in the message and you're surprised why?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
patryx
PostPosted: Thu Aug 16, 2007 3:39 am    Post subject: Reply with quote

Novice

Joined: 07 Aug 2007
Posts: 12
Location: Poland

OK but if I do:

Code:


//header2.setDeadLetterReasonCode( MQRC_STRUC_ID_ERROR )



and compile and run, the reason is the same...

DeadLetterReasonCode is an information why sth couldn't be delivered to the destination...
so what should i put there just to can read dead-letter header?
_________________
Patryx
Back to top
View user's profile Send private message MSN Messenger
Vitor
PostPosted: Thu Aug 16, 2007 3:48 am    Post subject: Reply with quote

Grand High Poobah

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

patryx wrote:
so what should i put there just to can read dead-letter header?


Ok, so should have looked more closely at your code.

There is a fundamental problem with your code. You need to rethink what you're trying to do, particually in reference to what that error code means, and you'll understand what's wrong.

I also repeat that we're not a training resource. If you're doing this as a university exercise that makes assistance given here even more iffy as your work will not be entirely original to yourself and at worst plagaism.

Especially dicey if whoever's given you the exercise is an MQer and knows about this board!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
patryx
PostPosted: Thu Aug 16, 2007 3:56 am    Post subject: Reply with quote

Novice

Joined: 07 Aug 2007
Posts: 12
Location: Poland

Ok, i understand that you don;t know also but thanks for trying...

I try to simulate deadletterheader and then put a message with it in into local queue (just to have a chance to browse messages with deadletterheaders) because this week I don't have permission to get to the system.dead.letter.queue ... ok but it doesn't matter...:/
_________________
Patryx
Back to top
View user's profile Send private message MSN Messenger
Vitor
PostPosted: Thu Aug 16, 2007 4:12 am    Post subject: Reply with quote

Grand High Poobah

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

patryx wrote:
Ok, i understand that you don;t know also but thanks for trying...


Thank you in return for your understanding. It's been hard for me the last few years, earning a living as a C++ contractor with such limited knowledge. Tough market.

patryx wrote:
I try to simulate deadletterheader and then put a message with it in into local queue (just to have a chance to browse messages with deadletterheaders) because this week I don't have permission to get to the system.dead.letter.queue


I got that, or at least did when I read your code instead of glancing at it (which was my bad - shouldn't try to do the day job while posting). It's not going to work the way you've set it up.

And tell your MQ Admin not to use SYSTEM.DEAD.LETTER.QUEUE - define another local queue and use that as the queue manager's DLQ.

(Not connected to your problem but I throw it in for free)
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
amisinai
PostPosted: Fri Aug 17, 2007 12:35 pm    Post subject: using the default SYSTEM.DEAD.LETTER.QUEUE Reply with quote

Novice

Joined: 17 Aug 2007
Posts: 10
Location: Israel

Hi Vitor,

"And tell your MQ Admin not to use SYSTEM.DEAD.LETTER.QUEUE - define another local queue and use that as the queue manager's DLQ."

What are the benefits of changing the default dead letter queue name?

Avichai
Back to top
View user's profile Send private message
Vitor
PostPosted: Sat Aug 18, 2007 2:22 pm    Post subject: Re: using the default SYSTEM.DEAD.LETTER.QUEUE Reply with quote

Grand High Poobah

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

amisinai wrote:
"And tell your MQ Admin not to use SYSTEM.DEAD.LETTER.QUEUE - define another local queue and use that as the queue manager's DLQ."

What are the benefits of changing the default dead letter queue name?


At the simplest, MQExplorer doesn't display SYSTEM objects by default so you can't see message piling up in it.

Aside from that, it's considered best practice to use SYSTEM objects as suggested templates rather than as working objects.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next Page 2 of 3

MQSeries.net Forum Index » General IBM MQ Support » needed some samples connected with dead-letter queue...
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.