Compare commits
9 Commits
mqsload-1_
...
mqsload-1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d327c3e4e9 | ||
|
|
15b8cece80 | ||
|
|
20cc7fc471 | ||
|
|
402f904383 | ||
|
|
f3b64d8cc5 | ||
|
|
c03202827e | ||
|
|
5bd41e53ef | ||
|
|
0ffc88e129 | ||
|
|
7187b8e088 |
66
MQSLoad.java
66
MQSLoad.java
@@ -1,7 +1,7 @@
|
|||||||
// $RCSfile: MQSLoad.java,v $
|
// $RCSfile: MQSLoad.java,v $
|
||||||
// $Revision: 1.5 $
|
// $Revision: 1.8 $
|
||||||
// $Name: $
|
// $Name: $
|
||||||
// $Date: 2002/05/02 17:09:35 $
|
// $Date: 2002/05/21 15:48:09 $
|
||||||
// $Author: giberta1 $
|
// $Author: giberta1 $
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -35,7 +35,7 @@ import java.text.*;
|
|||||||
|
|
||||||
public class MQSLoad
|
public class MQSLoad
|
||||||
{
|
{
|
||||||
private MQQueueManager QMng;
|
private MQQueueManager QMng = null;
|
||||||
private String QMng_Name = "";
|
private String QMng_Name = "";
|
||||||
private MQQueue MsgQ;
|
private MQQueue MsgQ;
|
||||||
private String MsgQ_Name;
|
private String MsgQ_Name;
|
||||||
@@ -43,7 +43,12 @@ public class MQSLoad
|
|||||||
private String File_Name;
|
private String File_Name;
|
||||||
private String Field_Break = "";
|
private String Field_Break = "";
|
||||||
private String Message_Break = "\r\n";
|
private String Message_Break = "\r\n";
|
||||||
|
private String Message_Tail = "";
|
||||||
private boolean Keep_Message_Break = false;
|
private boolean Keep_Message_Break = false;
|
||||||
|
private String MQSLoad_Revision = "$Revision: 1.8 $";
|
||||||
|
private String MQSLoad_Tag = "$Name: $";
|
||||||
|
private String MQSLoad_Date = "$Date: 2002/05/21 15:48:09 $";
|
||||||
|
private String MQSLoad_Author = "$Author: giberta1 $";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -222,6 +227,18 @@ public class MQSLoad
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ( args[argc].equals( "-mt"))
|
||||||
|
{
|
||||||
|
if( argc < ( args.length + 1))
|
||||||
|
{
|
||||||
|
Message_Tail = Str_Format( args[++argc]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.out.println( "Invalid number of command line options...");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ( args[argc].equals( "-kmb"))
|
else if ( args[argc].equals( "-kmb"))
|
||||||
{
|
{
|
||||||
Keep_Message_Break = true;
|
Keep_Message_Break = true;
|
||||||
@@ -258,15 +275,27 @@ public class MQSLoad
|
|||||||
|
|
||||||
private void MQSInit() throws Exception
|
private void MQSInit() throws Exception
|
||||||
{
|
{
|
||||||
try
|
short retry = 0;
|
||||||
{
|
final short RETRY_MAX = 10;
|
||||||
QMng = new MQQueueManager( QMng_Name);
|
|
||||||
// System.out.println( "QManager Open: (" + QMng + ") !");
|
|
||||||
}
|
while( QMng == null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
QMng = new MQQueueManager( QMng_Name);
|
||||||
|
// System.out.println( "QManager Open: (" + QMng + ") !");
|
||||||
|
}
|
||||||
|
|
||||||
catch( Exception Expt)
|
catch( Exception Expt)
|
||||||
{
|
{
|
||||||
throw Expt;
|
System.out.print("!");
|
||||||
|
|
||||||
|
if( retry++ > RETRY_MAX)
|
||||||
|
{
|
||||||
|
throw Expt;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -444,6 +473,8 @@ public class MQSLoad
|
|||||||
if( next_message <= cur_window_size)
|
if( next_message <= cur_window_size)
|
||||||
{
|
{
|
||||||
// System.out.println( "* Write Msg CurPos: (" + cur_pos + ")");
|
// System.out.println( "* Write Msg CurPos: (" + cur_pos + ")");
|
||||||
|
output_msg.writeString( Message_Tail);
|
||||||
|
|
||||||
if( Keep_Message_Break)
|
if( Keep_Message_Break)
|
||||||
{
|
{
|
||||||
output_msg.writeString( Message_Break);
|
output_msg.writeString( Message_Break);
|
||||||
@@ -505,11 +536,14 @@ public class MQSLoad
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
System.out.println("MQSLoad: " + MQSLoad_Tag + " / " + MQSLoad_Date + " / " + MQSLoad_Author);
|
||||||
|
|
||||||
if( ( args.length < 2) || ( args.length > 6))
|
if( ( args.length < 2) || ( args.length > 6))
|
||||||
{
|
{
|
||||||
System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] [-kmb] <Output_MsgQueue_Name> <Input_File_Name>");
|
System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] [-mt \"message_tail\"] [-kmb] <Output_MsgQueue_Name> <Input_File_Name>");
|
||||||
System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")");
|
System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ")");
|
||||||
|
|
||||||
|
System.exit( 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -518,7 +552,7 @@ public class MQSLoad
|
|||||||
Arg_Parse( args);
|
Arg_Parse( args);
|
||||||
|
|
||||||
System.out.println( "Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")");
|
System.out.println( "Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")");
|
||||||
System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")");
|
System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ")");
|
||||||
|
|
||||||
MQSInit();
|
MQSInit();
|
||||||
|
|
||||||
@@ -563,6 +597,8 @@ public class MQSLoad
|
|||||||
|
|
||||||
MQSDeInit();
|
MQSDeInit();
|
||||||
System.out.println( "MQS Load Completed !");
|
System.out.println( "MQS Load Completed !");
|
||||||
|
|
||||||
|
System.exit( 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -570,6 +606,8 @@ public class MQSLoad
|
|||||||
{
|
{
|
||||||
System.out.println("Exception: (" + Expt + ") !");
|
System.out.println("Exception: (" + Expt + ") !");
|
||||||
Expt.printStackTrace();
|
Expt.printStackTrace();
|
||||||
|
|
||||||
|
System.exit( 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# $RCSfile: ReadMe.txt,v $
|
# $RCSfile: ReadMe.txt,v $
|
||||||
# $Revision: 1.6 $
|
# $Revision: 1.7 $
|
||||||
# $Name: $
|
# $Name: $
|
||||||
# $Date: 2002/05/02 17:24:15 $
|
# $Date: 2002/05/21 15:22:00 $
|
||||||
# $Author: giberta1 $
|
# $Author: giberta1 $
|
||||||
|
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ Notes:
|
|||||||
|
|
||||||
- Message breaks are used for message separation in the batch file,
|
- Message breaks are used for message separation in the batch file,
|
||||||
- Message breaks are striped from the sended message if "-kmb" (keep message break) is not set,
|
- Message breaks are striped from the sended message if "-kmb" (keep message break) is not set,
|
||||||
|
- Message tail specified after "-mt" option is inserted between message and message break,
|
||||||
- Field breaks are striped from the sended message.
|
- Field breaks are striped from the sended message.
|
||||||
|
|
||||||
- Windows text files: newline is specified as "\r\n",
|
- Windows text files: newline is specified as "\r\n",
|
||||||
@@ -55,5 +56,7 @@ Usage Examples:
|
|||||||
java MQSLoad -mb "---MESSAGE-BREAK---\r\n" SWIFT-QUEUE swift-batch.txt
|
java MQSLoad -mb "---MESSAGE-BREAK---\r\n" SWIFT-QUEUE swift-batch.txt
|
||||||
- To load a raw swift batch file "swift-batch-raw.txt" with "}\r\n" message break into the MQ/Series "SWIFT-QUEUE" and by keeping message break separator use:
|
- To load a raw swift batch file "swift-batch-raw.txt" with "}\r\n" message break into the MQ/Series "SWIFT-QUEUE" and by keeping message break separator use:
|
||||||
java MQSLoad -mb "}\r\n" -kmb SWIFT-QUEUE swift-batch-raw.txt
|
java MQSLoad -mb "}\r\n" -kmb SWIFT-QUEUE swift-batch-raw.txt
|
||||||
|
- To load a raw swift batch file "swift-batch-raw.txt" with "}\r\n" message break into the MQ/Series "SWIFT-QUEUE" and by keeping only "}" as end of message use:
|
||||||
|
java MQSLoad -mb "}\r\n" -mt "}" SWIFT-QUEUE swift-batch-raw.txt
|
||||||
- To load a csv batch file "batch.csv" with ";" field separator into the MQ/Series "DATA-QUEUE" use:
|
- To load a csv batch file "batch.csv" with ";" field separator into the MQ/Series "DATA-QUEUE" use:
|
||||||
java MQSLoad -fb ";" DATA-QUEUE csv-batch.csv
|
java MQSLoad -fb ";" DATA-QUEUE csv-batch.csv
|
||||||
|
|||||||
@@ -1,13 +1,31 @@
|
|||||||
# $RCSfile: ReleaseNotes.txt,v $
|
# $RCSfile: ReleaseNotes.txt,v $
|
||||||
# $Revision: 1.3 $
|
# $Revision: 1.6 $
|
||||||
# $Name: $
|
# $Name: $
|
||||||
# $Date: 2002/05/02 17:17:28 $
|
# $Date: 2002/05/21 15:55:17 $
|
||||||
# $Author: giberta1 $
|
# $Author: giberta1 $
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
MQSLoad V 1.1.3 - A. Gibert - 21/05/02
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Add message tail option "-mt",
|
||||||
|
Add MQQueueManager() auto retry,
|
||||||
|
Add version, date and author print out.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
MQSLoad V 1.1.2 - A. Gibert - 06/05/02
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Add return code handling.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
MQSLoad V 1.1.1 - A. Gibert - 02/05/02
|
MQSLoad V 1.1.1 - A. Gibert - 02/05/02
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
5411
test-swift-batch-big1.txt
Normal file
5411
test-swift-batch-big1.txt
Normal file
File diff suppressed because it is too large
Load Diff
49
test-swift-batch-big2.txt
Normal file
49
test-swift-batch-big2.txt
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMCAXXX0857229951}{2:O1001511000801CICPFRPPAXXX65003436280008011611N}{4:
|
||||||
|
:20:CIC0001
|
||||||
|
:32A:000918EUR25062,66
|
||||||
|
:50:SOCIETE S.A.
|
||||||
|
PARIS
|
||||||
|
FRANCE
|
||||||
|
:57A:BCMAMAMCXXX
|
||||||
|
:59:I.A.M.
|
||||||
|
FES
|
||||||
|
MAROC
|
||||||
|
:70:/RFB/SOC01901
|
||||||
|
:71A:BEN
|
||||||
|
-}{5:{MAC:BCED2F18}{CHK:075B64FB4533}}
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMC1XXX0000000000}{2:I730BNPAFRPPXXXXN}{4:
|
||||||
|
:20:ELC00001007
|
||||||
|
:21:TESTS-DL-003
|
||||||
|
:30:010629
|
||||||
|
-}
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMC1XXX0000000000}{2:I710BCPCMACCXXXXN}{4:
|
||||||
|
:27:1/1
|
||||||
|
:40B:IRREVOCABLE TRANSFERABLE
|
||||||
|
ADDING OUR CONFIRMATION
|
||||||
|
:20:ELC00001002
|
||||||
|
:21:POB00001001
|
||||||
|
:31C:010328
|
||||||
|
:31D:010528PARIS
|
||||||
|
:52A:BARCGB22XXX
|
||||||
|
:50:SOCIETE ABC
|
||||||
|
AVENUE DES ALPES
|
||||||
|
CASABLANCA
|
||||||
|
:59:HUSUM PLASTIC
|
||||||
|
:32B:MAD100000,00
|
||||||
|
:41A:BARCGB22XXX
|
||||||
|
BY PAYMENT
|
||||||
|
:43P:NOT ALLOWED
|
||||||
|
:43T:NOT ALLOWED
|
||||||
|
:44A:GERMANY
|
||||||
|
:44B:CASABLANCA
|
||||||
|
:71B:ALL FOREIGN BANK CHARGES ARE FOR
|
||||||
|
THE ACCOUNT OF THE BENEFICIARY
|
||||||
|
:49:WITHOUT
|
||||||
|
-}
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTEND
|
||||||
80
test-swift-batch.txt
Normal file
80
test-swift-batch.txt
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
SWIFTBEGIN
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMCAXXX0857229951}{2:O1001511000801CICPFRPPAXXX65003436280008011611N}{4:
|
||||||
|
:20:CIC0001
|
||||||
|
:32A:000918EUR25062,66
|
||||||
|
:50:SOCIETE S.A.
|
||||||
|
PARIS
|
||||||
|
FRANCE
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTBEGIN
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMCAXXX0857229951}{2:O1001511000801CICPFRPPAXXX65003436280008011611N}{4:
|
||||||
|
:20:CIC0001
|
||||||
|
:32A:000918EUR25062,66
|
||||||
|
:50:SOCIETE S.A.
|
||||||
|
PARIS
|
||||||
|
FRANCE
|
||||||
|
:57A:BCMAMAMCXXX
|
||||||
|
:59:I.A.M.
|
||||||
|
FES
|
||||||
|
MAROC
|
||||||
|
:70:/RFB/SOC01901
|
||||||
|
:71A:BEN
|
||||||
|
-}{5:{MAC:BCED2F18}{CHK:075B64FB4533}}
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTABORT
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTBEGIN
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMCAXXX0857229951}{2:O1001511000801CICPFRPPAXXX65003436280008011611N}{4:
|
||||||
|
:20:CIC0001
|
||||||
|
:32A:000918EUR25062,66
|
||||||
|
:50:SOCIETE S.A.
|
||||||
|
PARIS
|
||||||
|
FRANCE
|
||||||
|
:57A:BCMAMAMCXXX
|
||||||
|
:59:I.A.M.
|
||||||
|
FES
|
||||||
|
MAROC
|
||||||
|
:70:/RFB/SOC01901
|
||||||
|
:71A:BEN
|
||||||
|
-}{5:{MAC:BCED2F18}{CHK:075B64FB4533}}
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMC1XXX0000000000}{2:I730BNPAFRPPXXXXN}{4:
|
||||||
|
:20:ELC00001007
|
||||||
|
:21:TESTS-DL-003
|
||||||
|
:30:010629
|
||||||
|
-}
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTOUT
|
||||||
|
{1:F01BCMAMAMC1XXX0000000000}{2:I710BCPCMACCXXXXN}{4:
|
||||||
|
:27:1/1
|
||||||
|
:40B:IRREVOCABLE TRANSFERABLE
|
||||||
|
ADDING OUR CONFIRMATION
|
||||||
|
:20:ELC00001002
|
||||||
|
:21:POB00001001
|
||||||
|
:31C:010328
|
||||||
|
:31D:010528PARIS
|
||||||
|
:52A:BARCGB22XXX
|
||||||
|
:50:SOCIETE ABC
|
||||||
|
AVENUE DES ALPES
|
||||||
|
CASABLANCA
|
||||||
|
:59:HUSUM PLASTIC
|
||||||
|
:32B:MAD100000,00
|
||||||
|
:41A:BARCGB22XXX
|
||||||
|
BY PAYMENT
|
||||||
|
:43P:NOT ALLOWED
|
||||||
|
:43T:NOT ALLOWED
|
||||||
|
:44A:GERMANY
|
||||||
|
:44B:CASABLANCA
|
||||||
|
:71B:ALL FOREIGN BANK CHARGES ARE FOR
|
||||||
|
THE ACCOUNT OF THE BENEFICIARY
|
||||||
|
:49:WITHOUT
|
||||||
|
-}
|
||||||
|
---MESSAGE-BREAK---
|
||||||
|
SWIFTEND
|
||||||
Reference in New Issue
Block a user