1 | # notification-processor
|
2 |
|
3 | [![NPM version](https://badge.fury.io/js/notification-processor.png)](http://badge.fury.io/js/notification-processor)
|
4 |
|
5 | # Breaking change
|
6 | * Configure API URL and Notification API URL at job processor
|
7 | ```Javascript
|
8 | //2.x
|
9 | require("notification-processor").JobProcessor({
|
10 | buildOpts: (message) => ({}), notificationApiUrl: "apiNotificationUrl"
|
11 | })
|
12 |
|
13 | //3.x
|
14 | require("notification-processor").JobProcessor({
|
15 | apiUrl: "",
|
16 | notificationApiUrl: ""
|
17 | })
|
18 | ```
|
19 |
|
20 | # New Features
|
21 | * Adding request async processor
|
22 |
|
23 | ```Javascript
|
24 | require("notification-processor").RequestAsyncProcessor({
|
25 | apiUrl: "baseAPI..."
|
26 | silentErrors: []
|
27 | })
|
28 | ```
|
29 |
|
30 | # Migrating 1.x -> 2.x
|
31 |
|
32 | ## Deadletter Processor
|
33 | ```Javascript
|
34 | // 1.x
|
35 | const buildOpts = (message) => { return .... }
|
36 | deadletterProcessor = DeadletterProcessor({
|
37 | connection: connection,
|
38 | name: "aFunctionName",
|
39 | maxDequeueCount: 1,
|
40 | rowKeyGenerator: (message) => { return ...... }
|
41 | }, processor())
|
42 |
|
43 | // 2.x
|
44 | const buildOpts = (message) => { return .... }
|
45 | const sender = {
|
46 | resource: (notification) => { return ... }
|
47 | user: (notification) => { return ... }
|
48 | }
|
49 |
|
50 | deadletterProcessor = DeadletterProcessor({
|
51 | connection: connection,
|
52 | name: "aFunctionName",
|
53 | maxDequeueCount: 1,
|
54 | sender: sender
|
55 | }, processor())
|
56 |
|
57 | ```
|
58 |
|
59 | ## Job Processor
|
60 | ```JavaScript
|
61 |
|
62 | // 1.x
|
63 | const buildOpts = (message) => { return .... }
|
64 | const processor = JobsProcessor(buildOpts, nonRetryable)
|
65 |
|
66 | // 2.x
|
67 | const buildOpts = ({ message }) => { return ...... }
|
68 | const processor = JobsProcessor({
|
69 | buildOpts: optionsGenerator,
|
70 | maxRetries,
|
71 | nonRetryable
|
72 | })
|
73 | ```
|
74 |
|
75 | ## To publish
|
76 | ```
|
77 | npm version [major/minor/patch]
|
78 | npm publish
|
79 | git push origin HEAD
|
80 | git push origin HEAD --tags
|
81 | ``` |
\ | No newline at end of file |