|
175 | 175 | # same named event hub with different configuration is allowed |
176 | 176 | {'event_hub_name0' => { |
177 | 177 | 'event_hub_connection' => 'Endpoint=sb://...', |
| 178 | + 'storage_connection' => 'DefaultEndpointsProtocol=https;AccountName=...', |
178 | 179 | 'consumer_group' => 'ls'}} |
179 | 180 | ], |
180 | 181 | 'codec' => 'plain', |
181 | 182 | 'consumer_group' => 'default_consumer_group', |
182 | 183 | 'max_batch_size' => 21, |
| 184 | + 'prefetch_count' => 250, |
| 185 | + 'receive_timeout' => 90, |
| 186 | + 'initial_position' => 'beginning', |
| 187 | + 'initial_position_look_back' => 7200, |
| 188 | + 'checkpoint_interval' => 15, |
| 189 | + 'decorate_events' => false, |
183 | 190 | 'threads' => 9 |
184 | 191 | } |
185 | 192 | end |
186 | 193 | it_behaves_like "an exploded Event Hub config", 1 |
187 | | - it "it explodes the 2cnd advanced config event hub correctly" do |
| 194 | + |
| 195 | + it "it explodes the second advanced config event hub correctly (with individual and inherited settings)" do |
188 | 196 | exploded_config = input.event_hubs_exploded |
189 | 197 | expect(exploded_config[1]['event_hubs'].size).to be == 1 #always 1 in the exploded form |
190 | 198 | expect(exploded_config[1]['event_hubs'][0]).to eql('event_hub_name1') |
191 | 199 | expect(exploded_config[1]['event_hub_connections'][0].value).to eql('1Endpoint=sb://...') |
192 | 200 | expect(exploded_config[1]['storage_connection'].value).to eql('1DefaultEndpointsProtocol=https;AccountName=...') |
193 | 201 | expect(exploded_config[1]['threads']).to be == 9 |
194 | | - expect(exploded_config[1]['codec'].class.to_s).to eq("LogStash::Codecs::JSON") # different between configs |
195 | | - expect(exploded_config[1]['consumer_group']).to eql('cg1') # override global |
196 | | - expect(exploded_config[1]['max_batch_size']).to be == 21 # filled from global |
197 | | - expect(exploded_config[1]['prefetch_count']).to be == 300 # default |
| 202 | + expect(exploded_config[1]['codec'].class.to_s).to eq("LogStash::Codecs::JSON") |
| 203 | + expect(exploded_config[1]['consumer_group']).to eql('cg1') |
| 204 | + expect(exploded_config[1]['max_batch_size']).to be == 21 |
| 205 | + expect(exploded_config[1]['prefetch_count']).to be == 250 |
198 | 206 | expect(exploded_config[1]['receive_timeout']).to be == 41 |
199 | 207 | expect(exploded_config[1]['initial_position']).to eql('end') |
200 | | - expect(exploded_config[1]['initial_position_look_back']).to be == 86400 # default |
| 208 | + expect(exploded_config[1]['initial_position_look_back']).to be == 7200 |
201 | 209 | expect(exploded_config[1]['checkpoint_interval']).to be == 61 |
202 | 210 | expect(exploded_config[1]['decorate_events']).to be_falsy |
203 | 211 | expect(exploded_config[1]['storage_container']).to eq('alt_container') |
204 | 212 | end |
205 | 213 |
|
| 214 | + it "it explodes the third advanced config event hub correctly (mostly inherited settings)" do |
| 215 | + exploded_config = input.event_hubs_exploded |
| 216 | + expect(exploded_config[2]['event_hubs'].size).to be == 1 |
| 217 | + expect(exploded_config[2]['event_hubs'][0]).to eql('event_hub_name0') |
| 218 | + expect(exploded_config[2]['event_hub_connections'][0].value).to eql('Endpoint=sb://...') |
| 219 | + expect(exploded_config[2]['storage_connection'].value).to eql('DefaultEndpointsProtocol=https;AccountName=...') |
| 220 | + expect(exploded_config[2]['threads']).to be == 9 |
| 221 | + expect(exploded_config[2]['codec'].class.to_s).to eq("LogStash::Codecs::Plain") |
| 222 | + expect(exploded_config[2]['consumer_group']).to eql('ls') |
| 223 | + expect(exploded_config[2]['max_batch_size']).to be == 21 |
| 224 | + expect(exploded_config[2]['prefetch_count']).to be == 250 |
| 225 | + expect(exploded_config[2]['receive_timeout']).to be == 90 |
| 226 | + expect(exploded_config[2]['initial_position']).to eql('beginning') |
| 227 | + expect(exploded_config[2]['initial_position_look_back']).to be == 7200 |
| 228 | + expect(exploded_config[2]['checkpoint_interval']).to be == 15 |
| 229 | + end |
| 230 | + |
206 | 231 | it "it runs the Event Processor Host" do |
207 | 232 | mock_queue = double("queue") |
208 | 233 | mock_host = double("event_processor_host") |
|
0 commit comments