Compare commits

...

31 Commits

Author SHA1 Message Date
agibert
e461670367 - Add MQV7 support (Thanks to Yves MOYROUD !) 2013-11-08 17:17:12 +00:00
agibert
89c00936c2 Fix release date. 2009-01-05 17:41:42 +00:00
agibert
2d3d359d79 Document new options and add an example. 2009-01-05 17:40:17 +00:00
agibert
5904264927 Fix MQMessage character set handling,
Fix character set error handling.
2009-01-05 17:32:49 +00:00
agibert
c4d5a98daa Initial release. 2009-01-05 17:29:19 +00:00
agibert
f45cc9b0b1 - Fix usage print out. 2008-12-18 17:25:42 +00:00
agibert
94c2d94032 - Fix "-cc" usage print,
- Fix Java 1.4 compatibility,
- Add 2150 reason code handling in best effort mode.
2008-12-12 10:44:19 +00:00
agibert
0c88d68c22 - Add character convert option "-cc",
- Add best effort mode "-bem",
- Add error message count.
2008-12-12 00:08:11 +00:00
agibert
d53cbc6c99 - Major code rewrite and cleanup,
- Add binary data support,
- drop obsolete TI swift batch mode support,
- Add message skip option "-ms",
- Add message count option "-mc",
- Add repeat count option "-rc",
- Add character set option "-cs".
2008-12-11 13:52:05 +00:00
agibert
6c20aac629 Fix elapsed time computation ! 2008-11-10 01:52:00 +00:00
agibert
7bc0510954 Fix usage print out. 2008-01-03 13:46:01 +00:00
agibert
d46511d384 Add sleep time option "-st". 2007-12-11 16:50:50 +00:00
agibert
81f82b947f Add in 1.2.0 entry:
Add queue manager name option "-qm".
2007-06-05 09:29:21 +00:00
agibert
51a031b7ae Add queue manager name option "-qm". 2007-06-05 09:27:44 +00:00
giberta1
67d8b5f6c4 Add 1.1.5 entry. 2003-09-04 15:47:10 +00:00
giberta1
4bdbc1e2e1 Add Copy Mode (-cm). 2003-09-04 15:42:41 +00:00
giberta1
bf636a2cea Add -mbtm switch,
Implement message break trailer mode.
2002-11-14 13:40:24 +00:00
giberta1
00a78ea920 Add 1.1.4 entry:
Fix trim mode when tisbm off.
2002-07-29 10:00:03 +00:00
giberta1
675a925c00 Add trim_mode support whan TI swift batch mode off. 2002-07-29 09:56:18 +00:00
giberta1
33b67fe311 Add trim mode ("-tm") explanations. 2002-05-21 16:07:17 +00:00
giberta1
9174e00abe Add 1.1.3 entry:
Add trim mode support,
    Add "-tm" option,
    Add MQQueueManager() auto retry,
    Fix flush file name bad parsing bug,
    Add version, date and author print out.
2002-05-21 16:03:38 +00:00
giberta1
f390c41e76 Add version, date and author print out. 2002-05-21 15:44:45 +00:00
giberta1
e807001586 Add trim mode support,
Add "-tm" option,
Add MQQueueManager() auto retry,
Fix flush file name bad parsing bug.
2002-05-21 15:36:28 +00:00
giberta1
b3f10a6962 Add 1.1.2 entry:
Rename SWIFTABORT into SWIFTERROR,
    Add Legend printout line.
2002-05-13 16:38:12 +00:00
giberta1
49d568238e Rename SWIFTABORT message into SWIFTERROR,
Add legend message.
2002-05-13 16:28:02 +00:00
giberta1
a4bb9a9f1b Add 1.1.1 entry:
Add return code handling.
2002-05-06 10:00:34 +00:00
giberta1
781932ee0c Add System.exit() handling. 2002-05-06 09:51:49 +00:00
giberta1
930b2f46cc Add TI Swift batch mode explanations. 2002-05-03 17:23:49 +00:00
giberta1
e1bb79cd46 Add 1.1.0 entry:
Add TI Swift batch mode support.
2002-05-03 17:15:36 +00:00
giberta1
66eb71a01d Add TI Swift batch mode support,
Add "-tisbm" command line switch,
Add flush file support,
Add "-ffn" command line switch.
2002-05-03 17:12:58 +00:00
giberta1
55976ffe03 Fix MQSSave usage print: replace MQSLoad by MSSave ! 2002-05-02 17:08:58 +00:00
6 changed files with 968 additions and 465 deletions

View File

@ -1,16 +1,14 @@
// $RCSfile: MQSSave.java,v $
// $Revision: 1.2 $
// $Revision: 1.21 $
// $Name: $
// $Date: 2002/04/23 14:41:38 $
// $Author: giberta1 $
// $Date: 2013/11/08 17:17:12 $
// $Author: agibert $
/*
* 07/12/2001 - 11:45:14
*
* MQSSave.java - MQ/Seires queue to data file saver
* Copyright (C) 2002 Arnaud G. Gibert
* arnaud.gibert@misys.com
* www.misys.com
* MQSSave.java - MQ/Series queue to data file saver
* Copyright (C) 2001-2008 Arnaud G. Gibert
* mailto:arnaud@rx3.net
* http://www.rx3.org/dvp/MQSLoad
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -28,22 +26,41 @@
*/
import com.ibm.mq.*;
import com.ibm.mq.constants.*;
import java.io.*;
import java.text.*;
public class MQSSave
{
private MQQueueManager QMng;
private String MQSSave_Revision = "$Revision: 1.21 $";
private String MQSSave_Tag = "$Name: $";
private String MQSSave_Date = "$Date: 2013/11/08 17:17:12 $";
private String MQSSave_Author = "$Author: agibert $";
private MQQueueManager QMng = null;
private String QMng_Name = "";
private MQQueue MsgQ;
private String MsgQ_Name;
private int MsgQ_Open_Options = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_BROWSE | MQC.MQOO_INQUIRE;
private String File_Name;
private int MsgQ_Open_Options = CMQC.MQOO_INPUT_AS_Q_DEF | CMQC.MQOO_FAIL_IF_QUIESCING | CMQC.MQOO_BROWSE | CMQC.MQOO_INQUIRE;
private boolean Character_Convert = false;
private int Character_Set = 1208;
private int Sleep_Time = 0;
private String Message_Break = "\r\n";
private int Message_Skip = 0;
private int Message_Count = 0;
private int Repeat_Count = 1;
private boolean Copy_Mode = false;
private boolean Trim_Mode = false;
private boolean MBTrailer_Mode = false;
private boolean Best_Effort_Mode = false;
private String Output_File_Name;
private int Msg_Counter = 0;
private int Msg_Saved_Nb = 0;
private int Msg_Skiped_Nb = 0;
private int Msg_Error_Nb = 0;
private boolean CC_Error = false;
@ -189,7 +206,7 @@ public class MQSSave
//
//-------------------------------------------------------------------------------------------------------------------------
private void Arg_Parse( String args[]) throws Exception
private void Args_Parse( String args[]) throws Exception
{
int argc = 0;
@ -198,7 +215,47 @@ public class MQSSave
{
while( argc < args.length)
{
if ( args[argc].equals( "-mb"))
if ( args[argc].equals( "-qm"))
{
if( argc < ( args.length + 1))
{
QMng_Name = Str_Format( args[++argc]);
}
else
{
System.out.println( "Invalid number of command line options...");
throw new Exception();
}
}
else if ( args[argc].equals( "-cc"))
{
Character_Convert = true;
}
else if ( args[argc].equals( "-cs"))
{
if( argc < ( args.length + 1))
{
Character_Set = Integer.parseInt( args[++argc]);
}
else
{
System.out.println( "Invalid number of command line options...");
throw new Exception();
}
}
else if ( args[argc].equals( "-st"))
{
if( argc < ( args.length + 1))
{
Sleep_Time = Integer.parseInt( args[++argc]);
}
else
{
System.out.println( "Invalid number of command line options...");
throw new Exception();
}
}
else if ( args[argc].equals( "-mb"))
{
if( argc < ( args.length + 1))
{
@ -210,9 +267,61 @@ public class MQSSave
throw new Exception();
}
}
else if ( args[argc].equals( "-cm"))
{
Copy_Mode = true;
}
else if ( args[argc].equals( "-tm"))
{
Trim_Mode = true;
}
else if ( args[argc].equals( "-mbtm"))
{
MBTrailer_Mode = true;
}
else if ( args[argc].equals( "-bem"))
{
Best_Effort_Mode = true;
}
else if ( args[argc].equals( "-ms"))
{
if( argc < ( args.length + 1))
{
Message_Skip = Integer.parseInt( args[++argc]);
}
else
{
File_Name = args[argc++];
System.out.println( "Invalid number of command line options...");
throw new Exception();
}
}
else if ( args[argc].equals( "-mc"))
{
if( argc < ( args.length + 1))
{
Message_Count = Integer.parseInt( args[++argc]);
}
else
{
System.out.println( "Invalid number of command line options...");
throw new Exception();
}
}
else if ( args[argc].equals( "-rc"))
{
if( argc < ( args.length + 1))
{
Repeat_Count = Integer.parseInt( args[++argc]);
}
else
{
System.out.println( "Invalid number of command line options...");
throw new Exception();
}
}
else
{
Output_File_Name = args[argc++];
MsgQ_Name = args[argc++];
if( argc < args.length)
@ -241,28 +350,42 @@ public class MQSSave
//-------------------------------------------------------------------------------------------------------------------------
private void MQSInit() throws Exception
{
short retry = 0;
final short RETRY_MAX = 10;
while( QMng == null)
{
try
{
QMng = new MQQueueManager( QMng_Name);
// System.out.println( "QManager Open: (" + QMng + ") !");
// System.out.println( "QManager Open: (" + QMng + ") !");
}
catch( Exception Expt)
{
System.out.print("!");
if( retry++ > RETRY_MAX)
{
throw Expt;
}
}
}
try
{
MsgQ = QMng.accessQueue( MsgQ_Name, MsgQ_Open_Options, null, null, null);
// System.out.println( "MsgQ Open: (" + MsgQ + ") !");
// System.out.println( "MsgQ Open: (" + MsgQ + ") !");
MQException.log = null;
}
catch( Exception Expt)
{
QMng.disconnect();
// System.out.println( "QManager Close: (" + QMng + ") !");
// System.out.println( "QManager Close: (" + QMng + ") !");
throw Expt;
}
@ -281,9 +404,9 @@ public class MQSSave
try
{
MsgQ.close();
// System.out.println( "MsgQ Close: (" + MsgQ + ") !");
// System.out.println( "MsgQ Close: (" + MsgQ + ") !");
QMng.disconnect();
// System.out.println( "QManager Close: (" + QMng + ") !");
// System.out.println( "QManager Close: (" + QMng + ") !");
}
catch( Exception Expt)
@ -300,28 +423,53 @@ public class MQSSave
//
//-------------------------------------------------------------------------------------------------------------------------
private MQMessage MQSGet_Msg( MQMessage Msg) throws Exception
private MQMessage MQSGet_Msg( MQMessage Msg, boolean First) throws Exception
{
MQGetMessageOptions gmo = new MQGetMessageOptions();
try
{
if( MsgQ.getCurrentDepth() > 0)
if( First)
{
gmo.options = MQC.MQGMO_NO_WAIT | MQC.MQGMO_BROWSE_FIRST | MQC.MQGMO_CONVERT;
gmo.matchOptions = MQC.MQMO_NONE;
MsgQ.get( Msg, gmo);
gmo.options = CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_BROWSE_FIRST;
}
else
{
Msg = null;
gmo.options = CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_BROWSE_NEXT;
}
if( Character_Convert)
{
gmo.options = gmo.options | CMQC.MQGMO_CONVERT;
}
gmo.matchOptions = CMQC.MQMO_NONE;
MsgQ.get( Msg, gmo);
return( Msg);
}
catch( MQException Expt)
{
if( ( Expt.completionCode == 2) && ( Expt.reasonCode == 2033))
{
/* no more messages */
return( null);
}
if( Best_Effort_Mode && ( Expt.completionCode == 1) && ( ( Expt.reasonCode == 2110) || ( Expt.reasonCode == 2150)))
{
/* caracter convertion error */
CC_Error = true;
return( null);
}
throw Expt;
}
catch( Exception Expt)
{
//System.out.println("Exception: (" + Expt + ") !!!");
@ -344,8 +492,8 @@ public class MQSSave
try
{
gmo.options = MQC.MQGMO_NO_WAIT | MQC.MQGMO_CONVERT;
gmo.matchOptions = MQC.MQMO_MATCH_MSG_ID;
gmo.options = CMQC.MQGMO_NO_WAIT | CMQC.MQGMO_CONVERT;
gmo.matchOptions = CMQC.MQMO_MATCH_MSG_ID;
MsgQ.get( Msg, gmo);
}
@ -364,19 +512,21 @@ public class MQSSave
//
//-------------------------------------------------------------------------------------------------------------------------
private void Counter_Print( int Msg_Nb)
private void Counter_Print( String Mark)
{
if( ( Msg_Nb % 50) == 0)
if( ( Msg_Counter % 50) == 0)
{
System.out.print( "\n(" + Msg_Nb + ")\t");
System.out.print( "\n(" + Msg_Counter + ")\t");
}
if( ( Msg_Nb % 10) == 0)
if( ( Msg_Counter % 10) == 0)
{
System.out.print( " ");
}
System.out.print( ".");
System.out.print( Mark);
Msg_Counter++;
}
@ -387,49 +537,151 @@ public class MQSSave
//
//-------------------------------------------------------------------------------------------------------------------------
private int Save_File( BufferedOutputStream Output_File) throws Exception
private void Stand_By(int timer) throws Exception
{
if( timer > 0)
{
try
{
synchronized( this)
{
wait( timer);
}
}
catch(InterruptedException Expt)
{
throw Expt;
}
}
}
//-------------------------------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------------------------------
private boolean Msg_Get( MQMessage Input_Msg, int Msg_Id, int Msg_Skip, int Msg_Count, boolean Get_First) throws Exception
{
if( ( Msg_Count != 0) && ( Msg_Id >= ( Msg_Skip + Msg_Count)))
{
return(false);
}
else
{
Input_Msg = MQSGet_Msg( Input_Msg, Get_First);
if( Input_Msg != null)
{
if( Msg_Id < Msg_Skip)
{
Counter_Print( "#");
Msg_Skiped_Nb++;
}
else
{
Counter_Print( ".");
Msg_Saved_Nb++;
Stand_By( Sleep_Time);
}
return(true);
}
else
{
if( CC_Error)
{
Counter_Print( "*");
Msg_Error_Nb++;
return(true);
}
else
{
return(false);
}
}
}
}
//-------------------------------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------------------------------
private void File_Save( BufferedOutputStream Output_File, int Msg_Skip, int Msg_Count, boolean Copy_Mode) throws Exception
{
int msg_nb = 0;
MQMessage input_msg = new MQMessage();
byte[] buffer_byte;
byte[] buffer;
int msg_id = 0;
boolean get_first = true;
try
{
input_msg.format = MQC.MQFMT_STRING;
// input_msg.format = CMQC.MQFMT_STRING;
input_msg.characterSet = Character_Set;
do
/* Loop while Msg_Count not reatch */
while( Msg_Get( input_msg, msg_id, Msg_Skip, Msg_Count, get_first))
{
input_msg = MQSGet_Msg( input_msg);
get_first = false;
if( input_msg != null)
if( CC_Error == false)
{
Counter_Print( msg_nb++);
/* This message is not in error */
if( msg_nb > 1)
if( msg_id >= Msg_Skip)
{
/* This message is not skiped */
if( Msg_Saved_Nb > 1)
{
Output_File.write( Message_Break.getBytes());
}
buffer_byte = new byte[ input_msg.getMessageLength()];
input_msg.readFully( buffer_byte);
buffer = new byte[ input_msg.getMessageLength()];
input_msg.readFully( buffer);
Output_File.write( buffer_byte, 0, buffer_byte.length);
if( Trim_Mode)
{
String buffer_string = new String( buffer).trim();
buffer = buffer_string.getBytes();
}
Output_File.write( buffer, 0, buffer.length);
if( Copy_Mode == false )
{
MQSDelete_Msg( input_msg);
}
}
while( input_msg != null);
}
else
{
/* This message is in error */
System.out.println( "\n");
CC_Error = false;
}
return( msg_nb);
msg_id++;
}
if( MBTrailer_Mode)
{
Output_File.write( Message_Break.getBytes());
}
}
catch( Exception Expt)
{
// System.out.println("Exception: (" + Expt + ") !!!");
throw Expt;
}
}
@ -438,56 +690,104 @@ public class MQSSave
//-------------------------------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------------------------------
private void Usage_Print( ) throws Exception
{
System.out.println( "Usage: MQSSave [-qm \"Input_QueueMng_Name\"] [-cc] [-cs \"character_set\"] [-st \"sleep_time\"] [-mb \"message_break\"] [-cm] [-tm] [-mbtm] [-bem] [-ms \"message_skip\"] [-mc \"message_count\"] [-rc \"repeat_count\"] <Output_File_Name> <Input_MsgQueue_Name>");
System.out.println( "");
System.out.println( " Default: Input QueueMng Name: (" + QMng_Name + ") Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Copy Mode: (" + Copy_Mode + ") Trim Mode: (" + Trim_Mode + ") MsgBreak Trailer Mode: (" + MBTrailer_Mode + ") Best Effort Mode: (" + Best_Effort_Mode + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")");
}
//-------------------------------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------------------------------
private void Args_Print( ) throws Exception
{
System.out.println( "Output File Name: (" + Output_File_Name + ") Input QueueMng Name: (" + QMng_Name + ") Input MsgQue Name: (" + MsgQ_Name + ")");
System.out.println( "Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Copy Mode: (" + Copy_Mode + ") Trim Mode: (" + Trim_Mode + ") MsgBreak Trailer Mode: (" + MBTrailer_Mode + ") Best Effort Mode: (" + Best_Effort_Mode + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")");
}
//-------------------------------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------------------------------
public MQSSave( String args[])
{
int msg_nb;
int loop;
long time_begin, time_end;
double time_elapsed, speed;
NumberFormat nf = NumberFormat.getInstance();
BufferedOutputStream output_file = null;
try
{
System.out.println("MQSSave: " + MQSSave_Tag + " / " + MQSSave_Date + " / " + MQSSave_Author);
if( ( args.length < 2) || ( args.length > 4))
if( ( args.length < 2) || ( args.length > 19))
{
System.out.println( "Usage: MQSLoad [-mb \"message_break\"] <Output_File_Name> <Input_MsgQueue_Name>");
System.out.println( " Default: Message Break: (" + Str_UnFormat( Message_Break) + ")");
Usage_Print();
System.exit( 1);
}
else
{
System.out.println( "MQS Save Starting...");
Arg_Parse( args);
System.out.println( "Output File Name: (" + File_Name + ") Input MsgQue Name: (" + MsgQ_Name + ")");
System.out.println( "Message Break: (" + Str_UnFormat( Message_Break) + ")");
Args_Parse( args);
Args_Print();
MQSInit();
try
{
BufferedOutputStream Output_file = new BufferedOutputStream( new FileOutputStream( File_Name));
output_file = new BufferedOutputStream( new FileOutputStream( Output_File_Name));
System.out.println( "Legend: .: Saved #: Skiped *: Error");
try
{
// System.out.println("Output File Open: (" + Output_file + ") !");
// System.out.println( "Output File Open: (" + output_file + ") !");
time_begin = System.currentTimeMillis();
msg_nb = Save_File( Output_file);
for( loop = 0; loop < Repeat_Count; loop++ )
{
if( loop < ( Repeat_Count - 1))
{
File_Save( output_file, Message_Skip, Message_Count, true);
}
else
{
File_Save( output_file, Message_Skip, Message_Count, Copy_Mode);
}
}
time_end = System.currentTimeMillis();
time_elapsed = ( time_end - time_begin) / 100.0;
speed = msg_nb / time_elapsed;
time_elapsed = ( time_end - time_begin) / 1000.0;
speed = Msg_Saved_Nb / time_elapsed;
nf.setMinimumFractionDigits(2);
nf.setMaximumFractionDigits(2);
System.out.println( "Saved Message Nb: (" + msg_nb
System.out.println( "");
System.out.println( "");
System.out.println( "Saved Message Nb: (" + Msg_Saved_Nb
+ ") Skiped Messages Nb: (" + Msg_Skiped_Nb
+ ") Error Messages Nb: (" + Msg_Error_Nb
+ ") Elapsed Time: (" + nf.format(time_elapsed)
+ ") s Speed: (" + nf.format(speed)
+ ") msg/s");
@ -495,11 +795,11 @@ public class MQSSave
catch( Exception Expt)
{
Output_file.close();
output_file.close();
throw Expt;
}
Output_file.close();
output_file.close();
}
catch( Exception Expt)
@ -510,6 +810,8 @@ public class MQSSave
MQSDeInit();
System.out.println( "MQS Save Completed !");
System.exit( 0);
}
}
@ -517,8 +819,11 @@ public class MQSSave
{
System.out.println("Exception: (" + Expt + ") !");
Expt.printStackTrace();
System.exit( 1);
}
}
//-------------------------------------------------------------------------------------------------------------------------
}

View File

@ -1,8 +1,8 @@
# $RCSfile: ReadMe.txt,v $
# $Revision: 1.2 $
# $Revision: 1.6 $
# $Name: $
# $Date: 2002/04/23 18:04:38 $
# $Author: giberta1 $
# $Date: 2009/01/05 17:40:17 $
# $Author: agibert $
@ -10,6 +10,7 @@
Compilation:
------------
- Just type: "javac MQSSave.java" !
@ -21,10 +22,42 @@ Installation:
Usage:
------
MQSSave [-qm "Input_QueueMng_Name"] [-cc] [-cs "character_set"] [-st "sleep_time"] [-mb "message_break"] [-cm] [-tm] [-mbtm] [-bem] [-ms "message_skip"] [-mc "message_count"] [-rc "repeat_count"] <Output_File_Name> <Input_MsgQueue_Name>
Default: Input QueueMng Name: () Character Convert: (false) Character Set: (1208) Sleep Time: (0) Message Break: (\r\n) Copy Mode: (false) Trim Mode: (false) MsgBreak Trailer Mode: (false) Best Effort Mode: (false) Message Skip: (0) Message Count: (0) Repeat Count: (1)
Arguments:
----------
- Optional arguments:
-qm "Input_QueueMng_Name": Name of the queue manager to use,
-cc "character_convert": Switch on the caracter conversion (Set the MQGetMessageOptions to MQC.MQGMO_CONVERT),
-cs "character_set": MQMessage character set,
-st "sleep_time": Delay between message sending,
-mb "message_break": String used as message separator,
-cm "copy_mode": Don't remove messages from queue,
-tm "trim_mode": Remove trailing spaces at the message end,
-mbtm "msg_break_trailer_mode": Add a message break at the end of the last message,
-bem "best effort mode": Skip errors and continue to save the next message,
-ms "message_skip": Number of message to skip before to start the saving,
-mc "message_count": Number of message to save,
-rc "repeat_count": Number of time the whole process (start of file + skip + save) should be repeated.
- Mandatory arguments:
<Output_File_Name>: Name of the output file to save to,
<Input_MsgQueue_Name>: Name of the input message queue to save from.
Notes:
------
- MQSSave has been tested with MQ/Series 5.2,
- MQSSave has been tested with WMQ 6.0.
- "-mb" argument accept a string with formated escape character:
+ "\n" for newline,
@ -37,7 +70,9 @@ Notes:
- Windows text files: newline is specified as "\r\n",
- Unix text files: newline is specified as "\n".
- By default Message break is "\r\n".
- When trim mode is enabled (by setting "-tm" command line switch), all the trailing spaces are removed.
- By default Message break is "\r\n",
- This software is under the GNU General Public License. See GNU-GPL.txt.
@ -46,6 +81,8 @@ Notes:
Usage Example:
---------------
- To save the messages of the MQ/Series "SWIFT-QUEUE" queu into a swift batch file "swift-batch.txt" with "---MESSAGE-BREAK---" message separator use:
- To save the messages of the MQ/Series "SWIFT-QUEUE" queue into a swift batch file "swift-batch.txt" with "---MESSAGE-BREAK---" message separator use:
java MQSSave -mb "---MESSAGE-BREAK---\r\n" swift-batch.txt SWIFT-QUEUE
- To save 10 times the third message of the MQ/Series "SWIFT-QUEUE" queue into a swift batch file "swift-batch.txt" with "---MESSAGE-BREAK---" message separator without removing it from the queue use:
java MQSSave -mb "---MESSAGE-BREAK---\r\n" -cm -ms 2 -mc 1 -rc 10 swift-batch.txt SWIFT-QUEUE

View File

@ -1,15 +1,125 @@
# $RCSfile: ReleaseNotes.txt,v $
# $Revision: 1.2 $
# $Revision: 1.16 $
# $Name: $
# $Date: 2002/04/23 16:24:15 $
# $Author: giberta1 $
# $Date: 2009/01/05 17:41:42 $
# $Author: agibert $
--------------------------------------------------------------------------------
MQSSave V 1.0.0 - A. Gibert - 23/04/02
MQSSave V 2.0.0 - A. Gibert - 2009/01/05
--------------------------------------------------------------------------------
- Major code rewrite and cleanup,
- Add binary data support,
- Drop obsolete TI swift batch mode support,
- Add message skip option "-ms",
- Add message count option "-mc",
- Add repeat count option "-rc",
- Add character convert option "-cc",
- Add character set option "-cs",
- Add best effort mode "-bem",
- Add error message count,
- Fix Java 1.4 compatibility.
--------------------------------------------------------------------------------
MQSSave V 1.3.2 - A. Gibert - 2008/11/10
--------------------------------------------------------------------------------
Fix elapsed time computation !
--------------------------------------------------------------------------------
MQSSave V 1.3.1 - A. Gibert - 2008/01/03
--------------------------------------------------------------------------------
Fix usage print out.
--------------------------------------------------------------------------------
MQSSave V 1.3.0 - C. Colin / A. Gibert - 2007/12/10
--------------------------------------------------------------------------------
Add sleep time option "-st".
--------------------------------------------------------------------------------
MQSSave V 1.2.0 - A. Gibert - 2007/06/05
--------------------------------------------------------------------------------
Add queue manager name option "-qm".
--------------------------------------------------------------------------------
MQSSave V 1.1.5 - A. Gibert - 2003/09/04
--------------------------------------------------------------------------------
Add message break trailer mode support,
Add -mbtm option,
Add copy mode support,
Add "-cm" option.
--------------------------------------------------------------------------------
MQSSave V 1.1.4 - A. Gibert - 2002/07/29
--------------------------------------------------------------------------------
Fix trim mode support when tisbm off.
--------------------------------------------------------------------------------
MQSSave V 1.1.3 - A. Gibert - 2002/05/21
--------------------------------------------------------------------------------
Add trim mode support,
Add "-tm" option,
Add MQQueueManager() auto retry,
Fix flush file name bad parsing bug,
Add version, date and author print out.
--------------------------------------------------------------------------------
MQSSave V 1.1.2 - A. Gibert - 2002/05/13
--------------------------------------------------------------------------------
Rename SWIFTABORT into SWIFTERROR,
Add Legend printout line.
--------------------------------------------------------------------------------
MQSSave V 1.1.1 - A. Gibert - 2002/05/06
--------------------------------------------------------------------------------
Add return code handling.
--------------------------------------------------------------------------------
MQSSave V 1.1.0 - A. Gibert - 2002/05/03
--------------------------------------------------------------------------------
Add TI Swift batch mode support,
Add "-tisbm" command line switch,
Add flush file support,
Add "-ffn" command line switch,
Fix MQSSave usage print: replace MQSLoad by MSSave !
--------------------------------------------------------------------------------
MQSSave V 1.0.0 - A. Gibert - 2002/04/23
--------------------------------------------------------------------------------
First release.

1
test-charset-in-iso Normal file
View File

@ -0,0 +1 @@
ISO [И]

1
test-charset-in-utf Normal file
View File

@ -0,0 +1 @@
UTF8 [é]

49
test-charset.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/bash
function file_load
{
out="$1"
in="$2"
cc="$3"
cs="$4"
echo -n "CC: [$cc] CS: [$cs] $(cat $in)" >$$.tmp
mqsload -mb '\n---\n' $cc -cs $cs $out $$.tmp
\rm $$.tmp
}
function file_save
{
out="$1"
in="$2"
cc="$3"
cs="$4"
cm="$5"
mqssave -mb '\n---\n' $cc -cs $cs $cm -bem $out $in
}
file_load DLQ test-charset-in-utf "-cc" 1208
file_load DLQ test-charset-in-utf "-cc" 819
file_load DLQ test-charset-in-iso "-cc" 1208
file_load DLQ test-charset-in-iso "-cc" 819
file_load DLQ test-charset-in-utf " " 1208
file_load DLQ test-charset-in-utf " " 819
file_load DLQ test-charset-in-iso " " 1208
file_load DLQ test-charset-in-iso " " 819
\rm test-charset-out-cc-utf test-charset-out-cc-iso test-charset-out-__-utf test-charset-out-__-iso
file_save test-charset-out-cc-utf DLQ "-cc" 1208 "-cm"
file_save test-charset-out-cc-iso DLQ "-cc" 819 "-cm"
file_save test-charset-out-__-utf DLQ " " 1208 "-cm"
file_save test-charset-out-__-iso DLQ " " 819 " "