You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/configuration.md
+81-85Lines changed: 81 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ currentMenu: configuration
8
8
__InEngine.NET__ is configured with a JSON file called IntegrationEngine.json.
9
9
The configuration file has several sections, outlined below.
10
10
11
-
###WebApi
11
+
## WebApi
12
12
13
13
The _WebApi_ section contains settings for the InEngine.NET's WebApi.
14
14
Namely, the hostname and port of the web API.
@@ -28,100 +28,100 @@ Note that it is not recommended to use "*" wildcard, but a list of specific doma
28
28
}
29
29
```
30
30
31
-
### MessageQueue
31
+
##NLogAdapter
32
32
33
-
The _MessageQueue_ section contains settings for connecting to a RabbitMQ server.
34
-
If these settings are not correct, then a connection exception will be thrown when a job is triggered.
35
-
36
-
A queue called "myqueue" will not exist on a freshly installed RabbitMQ server.
37
-
It will need to be created.
33
+
The _NLogAdapter_ section contains settings for configuring the [NLog Common.Logging adapter](http://netcommon.sourceforge.net/docs/2.1.0/reference/html/ch01.html#logging-adapters-nlog).
38
34
39
35
```js
40
36
{
41
37
// ...
42
-
"MessageQueue": {
43
-
"QueueName":"myqueue",
44
-
"ExchangeName":"amq.direct",
45
-
"UserName":"inengine",
46
-
"Password":"secret",
47
-
"HostName":"localhost",
48
-
"VirtualHost":"/"
49
-
},
50
-
// ...
38
+
"NLogAdapter": {
39
+
"ConfigType":"File",
40
+
"ConfigFile":"IntegrationEngine.nlog.xml"
41
+
}
42
+
// ..
51
43
}
52
44
```
53
45
54
-
### Elasticsearch
46
+
##Integration Points
55
47
56
-
The _Elasticsearch_ section contains settings for connecting to a Elasticsearch server.
57
-
If these settings are not correct, then a connection exception will be thrown when a job is scheduled.
48
+
Any number of integration points [Integration Points](integration-points.html) can be configured.
49
+
All integration points should have a unique name defined in its _IntegrationPointName_ property.
58
50
59
-
```js
60
-
{
61
-
// ...
62
-
"Elasticsearch": {
63
-
"Protocol":"http",
64
-
"HostName":"localhost",
65
-
"Port":9200,
66
-
"DefaultIndex":"integration-engine"
67
-
},
68
-
// ...
69
-
}
70
-
```
51
+
### RabbitMQ
71
52
72
-
### Mail
53
+
The _RabbitMQ_ section contains settings for connecting to a RabbitMQ server.
54
+
If these settings are not correct, then a connection exception will be thrown when a job is triggered.
73
55
74
-
The _Mail_ section contains settings for connecting to an SMTP server.
75
-
If these settings are not correct, then a connection exception will be thrown when sending an email.
56
+
A queue called "myqueue" will not exist on a freshly installed RabbitMQ server.
57
+
It will need to be created.
76
58
77
59
```js
78
60
{
79
61
// ...
80
-
"Mail": {
81
-
"HostName":"localhost",
82
-
"Port":25
83
-
},
62
+
"IntegrationPoints": {
63
+
"RabbitMQ": [
64
+
{
65
+
"IntegrationPointName":"DefaultRabbitMQ",
66
+
"QueueName":"myqueue",
67
+
"ExchangeName":"amq.direct",
68
+
"UserName":"inengine",
69
+
"Password":"secret",
70
+
"HostName":"localhost",
71
+
"VirtualHost":"/"
72
+
}
73
+
],
74
+
}
84
75
// ...
85
76
}
86
77
```
87
78
88
-
### Database
79
+
### Elasticsearch
89
80
90
-
The _Database_ section contains settings for connecting to a either a SQL Server or MySQL server via [Entity Framework](http://msdn.microsoft.com/en-us/data/ef.aspx).
91
-
If these settings are not correct, then a connection exception will be thrown when a SQL job runs.
81
+
The _Elasticsearch_ section contains settings for connecting to a Elasticsearch server.
82
+
If these settings are not correct, then a connection exception will be thrown when a job is scheduled.
92
83
93
84
```js
94
85
{
95
86
// ...
96
-
"Database": {
97
-
"ServerType":"SQLServer",
98
-
"HostName":"localhost",
99
-
"Port":1433,
100
-
"DatabaseName":"IntegrationEngine",
101
-
"UserName":"inengine",
102
-
"Password":"secret"
87
+
"IntegrationPoints": {
88
+
"Elasticsearch": [
89
+
{
90
+
"IntegrationPointName":"DefaultElasticsearch",
91
+
"Protocol":"http",
92
+
"HostName":"localhost",
93
+
"Port":9200,
94
+
"DefaultIndex":"integration-engine"
95
+
}
96
+
]
103
97
}
104
-
// ..
98
+
// ...
105
99
}
106
100
```
107
101
108
-
### NLogAdapter
102
+
### Mail
109
103
110
-
The _NLogAdapter_ section contains settings for configuring the [NLog Common.Logging adapter](http://netcommon.sourceforge.net/docs/2.1.0/reference/html/ch01.html#logging-adapters-nlog).
104
+
The _Mail_ section contains settings for connecting to an SMTP server.
105
+
If these settings are not correct, then a connection exception will be thrown when sending an email.
111
106
112
107
```js
113
108
{
114
109
// ...
115
-
"NLogAdapter": {
116
-
"ConfigType":"File",
117
-
"ConfigFile":"IntegrationEngine.nlog.xml"
110
+
"IntegrationPoints": {
111
+
"Mail": [
112
+
{
113
+
"IntegrationPointName":"DefaultMail",
114
+
"HostName":"localhost",
115
+
"Port":25
116
+
}
117
+
]
118
118
}
119
-
// ..
119
+
// ...
120
120
}
121
121
```
122
122
123
123
## Sample Configuration
124
-
This is a sample configuration.
124
+
This is a sample minimum configuration.
125
125
126
126
```js
127
127
{
@@ -130,35 +130,31 @@ This is a sample configuration.
<dd>Lists the built-in integration jobs in the <a href="https://www.nuget.org/packages/IntegrationEngine.Core">InEngine.NET Core</a> package, and explains their usage.</dd>
Copy file name to clipboardExpand all lines: doc/integration-jobs.md
+7-44Lines changed: 7 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,15 @@ currentMenu: integration-jobs
5
5
6
6
# Integration Jobs
7
7
8
-
Integration jobs can do anything, not just retrieve, transform, and persist data.
9
-
They can also be made to send an email, run a console command, call some third party library, or anything else that can
8
+
Integration jobs contain a _Run_ method, thanks to _IIntegrationJob_, that run when the job is executed by the __InEngine.NET__ scheduler.
9
+
10
+
Integration jobs utilize [Integration Points](integration-points.html) to query and persist data.
11
+
They can also send an email, run a console command, call some third party library, or anything else that can
10
12
be done in a .NET application.
11
13
12
14
## Built-in Job Types
13
15
14
-
__InEngine.NET__ comes with a few built-in integration jobs defined in _IntegrationEngine.Core.Jobs_.
15
-
They are __Integration Job__, __Mail Job__, __Elasticsearch Job__, __Log Job__, and __SQL Job__.
16
+
__InEngine.NET__ comes with a few built-in integration jobs, defined in _IntegrationEngine.Core.Jobs_, described below.
16
17
17
18
### Integration Job
18
19
@@ -21,47 +22,9 @@ They are __Integration Job__, __Mail Job__, __Elasticsearch Job__, __Log Job__,
21
22
* The interface has one argumentless method called _Run_ which is executed when the job is triggered.
22
23
* All other jobs must implement _IIntegrationJob_ directly or indirectly.
23
24
24
-
### Elasticsearch Job
25
-
26
-
* Implement the _IElasticsearchJob_ interface to create an Elasticsearch Job.
27
-
* The _ElasticClient_ property of the _IElasticsearchJob_ is automatically instantiated and configured with the Elasticsearch settings in [IntegrationEngine.json](configuration.html).
28
-
* The _ElasticClient_ is an instance of _Nest.ElasticClient_.
29
-
* See the NEST [quick start](http://nest.azurewebsites.net/nest/quick-start.html) for information on how to use it.
30
-
31
-
### Log Job
32
-
33
-
* Implement the _ILogJob_ interface to create a log job.
34
-
* The _Log_ property of the _ILogJob_ is automatically instantiated and configured with the
35
-
[log4net](http://logging.apache.org/log4net/) settings in the host applications App.config file.
36
-
* The _Log_ instance can be configured to log to a variety of [logging targets](logging.apache.org/log4net/release/features.html#appenders).
37
-
* Messages and exception can be logged according to their [severity](http://logging.apache.org/log4net/release/manual/introduction.html#hierarchy).
38
-
39
-
### Mail Job
40
-
41
-
* Implement the _IMailJob_ interface to create a mail job.
42
-
* The _MailClient_ property of the _IMailJob_ is automatically instantiated and configured with the mail settings in [IntegrationEngine.json](configuration.html).
43
-
* The _MailClient_'s _Send_ method can be used to send a _System.Net.Mail.MailMessage_.
44
-
45
25
### Parameterized Job
46
26
47
27
* Implement the _IParameterizedJob_ interface to create a parameterized job.
48
-
* The _Parameters_ property of the _IParameterizedJob_ is automatically instantiated and populated with the Parameters dictionary stored in the trigger that is used to schedule the job.
28
+
* There is no need to directly implement _IIntegrationJob_ when implementing _IParameterizedJob_ as it already implements _IIntegrationJob_.
29
+
* The _Parameters_ property of _IParameterizedJo db_ is automatically instantiated and populated with the _Parameters_ IDictionary stored in the trigger that is used to schedule the job.
49
30
*_Parameters_ can be used to configure the job in some way.
50
-
51
-
### SQL Job
52
-
53
-
* Implement the _ISqlJob_ interface to create a sql job.
54
-
* The _DbContext_ property of the _ISqlJob_ is automatically instantiated and configured with the Database settings in [IntegrationEngine.json](configuration.html).
55
-
* The _Query_ property of the _ISqlJob_ must be populated with a valid SQL command before the _RunQuery<T>_ method is called.
56
-
* The generic parameter in the _RunQuery<T>_ method is a class that represents a record returned from the database.
57
-
* The _RunQuery<T>_ method returns a _IList<T>_ collection of records from the database.
58
-
59
-
#### Concrete SQL Job Class
60
-
61
-
There is also concrete class defined in _IntegrationEngine.Core.Jobs_ called _SqlJob_.
62
-
63
-
* It implements _ISqlJob_, _IMailJob_, amd _ILogJob_.
64
-
* A class derived from _SqlJob_ will run whatever query is assigned to its _Query_ property by default.
65
-
* However, both the _RunQuery<T>_ and _Run_ methods are marked as virtual and thus can be overridden.
66
-
* A common practice is to override the _Run_ method, call _RunQuery<T>_, examine the results, then send a notification email.
67
-
* The _Log_ property can be used to log when the query fails.
0 commit comments