@@ -12,13 +12,14 @@ namespace EasyNetQ.ConnectionString
12
12
public static class ConnectionStringGrammar
13
13
{
14
14
public static Parser < string > Text = Parse . CharExcept ( ';' ) . Many ( ) . Text ( ) ;
15
- public static Parser < ushort > Number = Parse . Number . Select ( ushort . Parse ) ;
15
+ public static Parser < ushort > UShortNumber = Parse . Number . Select ( ushort . Parse ) ;
16
+ public static Parser < int > IntNumber = Parse . Number . Select ( int . Parse ) ;
16
17
17
18
public static Parser < bool > Bool = ( Parse . CaseInsensitiveString ( "true" ) . Or ( Parse . CaseInsensitiveString ( "false" ) ) ) . Text ( ) . Select ( x => x . ToLower ( ) == "true" ) ;
18
19
19
20
public static Parser < HostConfiguration > Host =
20
21
from host in Parse . Char ( c => c != ':' && c != ';' && c != ',' , "host" ) . Many ( ) . Text ( )
21
- from port in Parse . Char ( ':' ) . Then ( _ => Number ) . Or ( Parse . Return ( ( ushort ) 0 ) )
22
+ from port in Parse . Char ( ':' ) . Then ( _ => UShortNumber ) . Or ( Parse . Return ( ( ushort ) 0 ) )
22
23
select new HostConfiguration { Host = host , Port = port } ;
23
24
24
25
public static Parser < IEnumerable < HostConfiguration > > Hosts = Host . ListDelimitedBy ( ',' ) ;
@@ -31,18 +32,19 @@ from port in Parse.Char(':').Then(_ => Number).Or(Parse.Return((ushort)0))
31
32
// add new connection string parts here
32
33
BuildKeyValueParser ( "amqp" , AMQP , c => c . AMQPConnectionString ) ,
33
34
BuildKeyValueParser ( "host" , Hosts , c => c . Hosts ) ,
34
- BuildKeyValueParser ( "port" , Number , c => c . Port ) ,
35
+ BuildKeyValueParser ( "port" , UShortNumber , c => c . Port ) ,
35
36
BuildKeyValueParser ( "virtualHost" , Text , c => c . VirtualHost ) ,
36
- BuildKeyValueParser ( "requestedHeartbeat" , Number , c => c . RequestedHeartbeat ) ,
37
+ BuildKeyValueParser ( "requestedHeartbeat" , UShortNumber , c => c . RequestedHeartbeat ) ,
37
38
BuildKeyValueParser ( "username" , Text , c => c . UserName ) ,
38
39
BuildKeyValueParser ( "password" , Text , c => c . Password ) ,
39
- BuildKeyValueParser ( "prefetchcount " , Number , c => c . PrefetchCount ) ,
40
- BuildKeyValueParser ( "timeout" , Number , c => c . Timeout ) ,
40
+ BuildKeyValueParser ( "prefetchCount " , UShortNumber , c => c . PrefetchCount ) ,
41
+ BuildKeyValueParser ( "timeout" , UShortNumber , c => c . Timeout ) ,
41
42
BuildKeyValueParser ( "publisherConfirms" , Bool , c => c . PublisherConfirms ) ,
42
43
BuildKeyValueParser ( "persistentMessages" , Bool , c => c . PersistentMessages ) ,
43
44
BuildKeyValueParser ( "product" , Text , c => c . Product ) ,
44
45
BuildKeyValueParser ( "platform" , Text , c => c . Platform ) ,
45
46
BuildKeyValueParser ( "useBackgroundThreads" , Bool , c => c . UseBackgroundThreads ) ,
47
+ BuildKeyValueParser ( "dispatcherQueueSize" , IntNumber , c => c . DispatcherQueueSize ) ,
46
48
BuildKeyValueParser ( "name" , Text , c => c . Name )
47
49
} . Aggregate ( ( a , b ) => a . Or ( b ) ) ;
48
50
0 commit comments