49
49
//
50
50
//---------------------------------------------------------------------------
51
51
using System ;
52
+ using System . Collections ;
52
53
using System . IO ;
53
54
using System . Text ;
54
55
@@ -64,9 +65,17 @@ public static int Main(string[] args) {
64
65
int optionIndex = 0 ;
65
66
bool durable = false ;
66
67
bool delete = false ;
68
+ IDictionary arguments = null ;
67
69
while ( optionIndex < args . Length ) {
68
70
if ( args [ optionIndex ] == "/durable" ) { durable = true ; }
69
71
else if ( args [ optionIndex ] == "/delete" ) { delete = true ; }
72
+ else if ( args [ optionIndex ] . StartsWith ( "/arg:" ) ) {
73
+ if ( arguments == null ) { arguments = new Hashtable ( ) ; }
74
+ string [ ] pieces = args [ optionIndex ] . Split ( new Char [ ] { ':' } ) ;
75
+ if ( pieces . Length >= 3 ) {
76
+ arguments [ pieces [ 1 ] ] = pieces [ 2 ] ;
77
+ }
78
+ }
70
79
else { break ; }
71
80
optionIndex ++ ;
72
81
}
@@ -79,6 +88,7 @@ public static int Main(string[] args) {
79
88
Console . Error . WriteLine ( "Available options:" ) ;
80
89
Console . Error . WriteLine ( " /durable declare a durable queue" ) ;
81
90
Console . Error . WriteLine ( " /delete delete after declaring" ) ;
91
+ Console . Error . WriteLine ( " /arg:KEY:VAL add longstr entry to arguments table" ) ;
82
92
return 1 ;
83
93
}
84
94
@@ -90,7 +100,9 @@ public static int Main(string[] args) {
90
100
using ( IModel ch = conn . CreateModel ( ) ) {
91
101
ushort ticket = ch . AccessRequest ( "/data" ) ;
92
102
93
- string finalName = ch . QueueDeclare ( ticket , inputQueueName , durable ) ;
103
+ string finalName = ch . QueueDeclare ( ticket , inputQueueName ,
104
+ false , durable , false , false ,
105
+ false , arguments ) ;
94
106
Console . WriteLine ( "{0}\t {1}" , finalName , durable ) ;
95
107
96
108
while ( ( optionIndex + 1 ) < args . Length ) {
0 commit comments