Skip to content

Commit

Permalink
Merge pull request #222 from emqx/develop
Browse files Browse the repository at this point in the history
Binary log issue
  • Loading branch information
jinfahua authored Apr 16, 2020
2 parents 1a3043a + ce49eff commit 8ac9a1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func init() {
Log.SetFormatter(&logrus.TextFormatter{
CallerPrettyfier: func(f *runtime.Frame) (string, string) {
filename := path.Base(f.File)
return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("%s:%d", filename, f.Line)
return "", fmt.Sprintf("%s:%d", filename, f.Line)
},
DisableColors: true,
FullTimestamp: true,
Expand Down
4 changes: 2 additions & 2 deletions fvt_scripts/edgex_sink_rule.jmx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
<JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="device Assertion" enabled="true">
<stringProp name="JSON_PATH">$.device</stringProp>
<stringProp name="EXPECTED_VALUE">demo</stringProp>
<boolProp name="JSONVALIDATION">true</boolProp>
<boolProp name="JSONVALIDATION">false</boolProp>
<boolProp name="EXPECT_NULL">false</boolProp>
<boolProp name="INVERT">false</boolProp>
<boolProp name="ISREGEX">false</boolProp>
Expand All @@ -429,7 +429,7 @@
<JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="humidity Assertion" enabled="true">
<stringProp name="JSON_PATH">$.readings[0].value</stringProp>
<stringProp name="EXPECTED_VALUE">81</stringProp>
<boolProp name="JSONVALIDATION">true</boolProp>
<boolProp name="JSONVALIDATION">false</boolProp>
<boolProp name="EXPECT_NULL">false</boolProp>
<boolProp name="INVERT">false</boolProp>
<boolProp name="ISREGEX">false</boolProp>
Expand Down
6 changes: 5 additions & 1 deletion xstream/extensions/edgex_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ func (es *EdgexSource) Open(ctx api.StreamContext, consumer chan<- api.SourceTup
if strings.ToLower(env.ContentType) == "application/json" {
e := models.Event{}
if err := e.UnmarshalJSON(env.Payload); err != nil {
log.Warnf("payload %s unmarshal fail: %v", env.Payload, err)
len := len(env.Payload)
if len > 200 {
len = 200
}
log.Warnf("payload %s unmarshal fail: %v", env.Payload[0:(len - 1)], err)
} else {
result := make(map[string]interface{})
meta := make(map[string]interface{})
Expand Down

0 comments on commit 8ac9a1e

Please sign in to comment.