Skip to content

Commit

Permalink
Remove redundant parts field from http
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffail committed Jul 20, 2018
1 parent e28aab9 commit 919bcb3
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion config/everything.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ pipeline:
parts:
- 0
http:
parts: []
request:
url: http://localhost:4195/post
verb: POST
Expand Down
1 change: 0 additions & 1 deletion config/processors/http.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
{
"type": "http",
"http": {
"parts": [],
"request": {
"backoff_on": [
429
Expand Down
1 change: 0 additions & 1 deletion config/processors/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pipeline:
processors:
- type: http
http:
parts: []
request:
backoff_on:
- 429
Expand Down
1 change: 0 additions & 1 deletion docs/processors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ the last element with be selected, and so on.
``` yaml
type: http
http:
parts: []
request:
backoff_on:
- 429
Expand Down
14 changes: 0 additions & 14 deletions lib/processor/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@ can use the ` + "[`process_map`](#process_map)" + ` or

// HTTPConfig contains any configuration for the HTTP processor.
type HTTPConfig struct {
Parts []int `json:"parts" yaml:"parts"`
Client client.Config `json:"request" yaml:"request"`
}

// NewHTTPConfig returns a HTTPConfig with default values.
func NewHTTPConfig() HTTPConfig {
return HTTPConfig{
Parts: []int{},
Client: client.NewConfig(),
}
}
Expand All @@ -76,7 +74,6 @@ func NewHTTPConfig() HTTPConfig {
// HTTP is a processor that executes HTTP queries on a message part and
// replaces the contents with the result.
type HTTP struct {
parts []int
client *client.Type

conf Config
Expand All @@ -95,7 +92,6 @@ func NewHTTP(
conf Config, mgr types.Manager, log log.Modular, stats metrics.Type,
) (Type, error) {
g := &HTTP{
parts: conf.HTTP.Parts,

conf: conf,
log: log.NewModule(".processor.http"),
Expand All @@ -121,16 +117,6 @@ func NewHTTP(
func (h *HTTP) ProcessMessage(msg types.Message) ([]types.Message, types.Response) {
h.mCount.Incr(1)

newMsg := msg.ShallowCopy()

targetParts := h.parts
if len(targetParts) == 0 {
targetParts = make([]int, newMsg.Len())
for i := range targetParts {
targetParts[i] = i
}
}

responseMsg, err := h.client.Send(msg)
if err != nil {
h.mErr.Incr(1)
Expand Down

0 comments on commit 919bcb3

Please sign in to comment.