From 2401c5127808690fe8515dff27dd8386dfb4fcb6 Mon Sep 17 00:00:00 2001 From: gmallard Date: Wed, 27 Jul 2016 16:32:10 -0400 Subject: [PATCH] JMS interop examples updated for common code / logging. --- jinterop/activemq/gorecv/gorecv.go | 242 ++++++++++++++++++++----------------- jinterop/activemq/gosend/gosend.go | 55 ++++----- jinterop/artemis/gorecv/gorecv.go | 242 ++++++++++++++++++++----------------- jinterop/artemis/gosend/gosend.go | 58 +++++---- version.go | 2 +- 5 files changed, 310 insertions(+), 289 deletions(-) rewrite jinterop/activemq/gorecv/gorecv.go (61%) rewrite jinterop/artemis/gorecv/gorecv.go (61%) diff --git a/jinterop/activemq/gorecv/gorecv.go b/jinterop/activemq/gorecv/gorecv.go dissimilarity index 61% index 96a43cf..d5f3652 100644 --- a/jinterop/activemq/gorecv/gorecv.go +++ b/jinterop/activemq/gorecv/gorecv.go @@ -1,114 +1,128 @@ -// -// Copyright © 2011-2016 Guy M. Allard -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/* -A message receiver, to demonstrate JMS interoperability. -*/ -package main - -import ( - "log" - "net" - "os" - // - "github.com/gmallard/stompngo" -) - -var ( - exampid = "gorecv: " - ll = log.New(os.Stdout, "GOJRCV ", log.Ldate|log.Lmicroseconds|log.Lshortfile) - nmsgs = 1 -) - -// Connect to a STOMP 1.2 broker, receive some messages and disconnect. -func main() { - ll.Printf("%s v1:%v\n", exampid, "starts_...") - - // Set up the connection. - n, e := net.Dial("tcp", "localhost:61613") - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "dial_complete_...") - ch := stompngo.Headers{"login", "userr", "passcode", "passw0rd", - "host", "localhost", "accept-version", "1.2"} - conn, e := stompngo.Connect(n, ch) - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_connect_complete_...") - - // Setup Headers ... - id := stompngo.Uuid() // Use package convenience function for unique ID - sbh := stompngo.Headers{"destination", "/queue/allards.queue", - "id", id} // subscribe/unsubscribe headers - - // Subscribe - sc, e := conn.Subscribe(sbh) - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_subscribe_complete_...") - - var md stompngo.MessageData - // Read data from the returned channel - for i := 1; i <= nmsgs; i++ { - select { - case md = <-sc: - case md = <-conn.MessageData: - // A RECEIPT or ERROR frame is unexpected here - ll.Fatalf("%s v1:%v\n", exampid, md) // Handle this - } - ll.Printf("%s v1:%v\n", exampid, "channel_read_complete_...") - // MessageData has two components: - // a) a Message struct - // b) an Error value. Check the error value as usual - if md.Error != nil { - ll.Fatalf("%s f4v:%v\n", exampid, md.Error) // Handle this - } - // - ll.Printf("Frame Type: %s\n", md.Message.Command) // Should be MESSAGE - wh := md.Message.Headers - for j := 0; j < len(wh)-1; j += 2 { - ll.Printf("Header: %s:%s\n", wh[j], wh[j+1]) - } - ll.Printf("Payload: %s\n", string(md.Message.Body)) // Data payload - } - // It is polite to unsubscribe, although unnecessary if a disconnect follows. - // With Stomp 1.1+, the same unique ID is required on UNSUBSCRIBE. Failure - // to provide it will result in an error return. - e = conn.Unsubscribe(sbh) // Same headers as Subscribe - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_unsubscribe_complete_...") - - // Disconnect from the Stomp server - dh := stompngo.Headers{} - e = conn.Disconnect(dh) - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_disconnect_complete_...") - // Close the network connection - e = n.Close() - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "network_close_complete_...") - - ll.Printf("%s v1:%v\n", exampid, "ends_...") -} +// +// Copyright © 2011-2016 Guy M. Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* +A message receiver, to demonstrate JMS interoperability. +*/ +package main + +import ( + "log" + "os" + "time" + // + "github.com/gmallard/stompngo" + // sngecomm methods are used specifically for these example clients. + "github.com/gmallard/stompngo_examples/sngecomm" +) + +var ( + exampid = "gorecv: " + ll = log.New(os.Stdout, "GOJRCV ", log.Ldate|log.Lmicroseconds|log.Lshortfile) + nmsgs = 1 + tag = "jintamqgr" +) + +// Connect to a STOMP broker, receive some messages and disconnect. +func main() { + + st := time.Now() + + // Standard example connect sequence + // Use AMQ port here + n, conn, e := sngecomm.CommonConnect(exampid, tag, ll) + if e != nil { + ll.Fatalf("%stag:%s connsess:%s main_on_connect error:%v", + exampid, tag, sngecomm.Lcs, + e.Error()) // Handle this ...... + } + + pbc := sngecomm.Pbc() // Print byte count + + // Setup Headers ... + id := stompngo.Uuid() // Use package convenience function for unique ID + d := "/queue/allards.queue" + sc := sngecomm.HandleSubscribe(conn, d, id, "auto") + ll.Printf("%stag:%s connsess:%s stomp_subscribe_complete\n", + exampid, tag, conn.Session()) + + // + var md stompngo.MessageData + // Read data from the returned channel + for i := 1; i <= nmsgs; i++ { + select { + case md = <-sc: + case md = <-conn.MessageData: + // Frames RECEIPT or ERROR not expected here + ll.Fatalf("%stag:%s connsess:%s bad_frame error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + ll.Printf("%stag:%s connsess:%s channel_read_complete\n", + exampid, tag, conn.Session()) + // MessageData has two components: + // a) a Message struct + // b) an Error value. Check the error value as usual + if md.Error != nil { + ll.Fatalf("%stag:%s connsess:%s error_read error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + ll.Printf("%stag:%s connsess:%s frame_type cmd:%s\n", + exampid, tag, conn.Session(), + md.Message.Command) + + if md.Message.Command != stompngo.MESSAGE { + ll.Fatalf("%stag:%s connsess:%s error_frame_type error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + wh := md.Message.Headers + for j := 0; j < len(wh)-1; j += 2 { + ll.Printf("%stag:%s connsess:%s Header:%s:%s\n", + exampid, tag, conn.Session(), + wh[j], wh[j+1]) + } + if pbc > 0 { + maxlen := pbc + if len(md.Message.Body) < maxlen { + maxlen = len(md.Message.Body) + } + ss := string(md.Message.Body[0:maxlen]) + ll.Printf("%stag:%s connsess:%s payload body:%s\n", + exampid, tag, conn.Session(), + ss) + } + } + + // + sngecomm.HandleUnsubscribe(conn, d, id) + ll.Printf("%stag:%s connsess:%s unsubscribe_complete\n", + exampid, tag, conn.Session()) + + // Standard example disconnect sequence + e = sngecomm.CommonDisconnect(n, conn, exampid, tag, ll) + if e != nil { + ll.Fatalf("%stag:%s connsess:%s main_disconnect error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + + ll.Printf("%stag:%s connsess:%s main_elapsed:%v\n", + exampid, tag, conn.Session(), + time.Now().Sub(st)) + +} diff --git a/jinterop/activemq/gosend/gosend.go b/jinterop/activemq/gosend/gosend.go index efeb404..ba30a9d 100644 --- a/jinterop/activemq/gosend/gosend.go +++ b/jinterop/activemq/gosend/gosend.go @@ -22,38 +22,35 @@ package main import ( "fmt" "log" - "net" "os" + "time" // "github.com/gmallard/stompngo" "github.com/gmallard/stompngo/senv" + // sngecomm methods are used specifically for these example clients. + "github.com/gmallard/stompngo_examples/sngecomm" ) var ( exampid = "gosend: " ll = log.New(os.Stdout, "GOJSND ", log.Ldate|log.Lmicroseconds|log.Lshortfile) nmsgs = 1 + tag = "jintamqjs" ) -// Connect to a STOMP 1.2 broker, send some messages and disconnect. +// Connect to a STOMP broker, send some messages and disconnect. func main() { - ll.Printf("%s v1:%v\n", exampid, "starts_...") - // Open a net connection - n, e := net.Dial("tcp", "localhost:61613") - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "dial_complete_...") + st := time.Now() - // Connect to broker - ch := stompngo.Headers{"login", "userr", "passcode", "passw0rd", - "host", "localhost", "accept-version", "1.2"} - conn, e := stompngo.Connect(n, ch) + // Standard example connect sequence + // Use AMQ port here + n, conn, e := sngecomm.CommonConnect(exampid, tag, ll) if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... + ll.Fatalf("%stag:%s connsess:%s main_on_connect error:%v", + exampid, tag, sngecomm.Lcs, + e.Error()) // Handle this ...... } - ll.Printf("%s v1:%v\n", exampid, "stomp_connect_complete_...") // Suppress content length here, so JMS will treat this as a 'text' message. sh := stompngo.Headers{"destination", "/queue/allards.queue"} @@ -68,24 +65,24 @@ func main() { mse := ms + fmt.Sprintf("%d", i) e := conn.Send(sh, mse) if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ... + ll.Fatalf("%stag:%s connsess:%s send_error error:%v\n", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... } - ll.Printf("%s v1:%v v2:%v\n", exampid, "send complete:", mse) + ll.Printf("%stag:%s connsess:%s send_complete\n", + exampid, tag, conn.Session()) } - // Disconnect from the Stomp server - dh := stompngo.Headers{} - e = conn.Disconnect(dh) + // Standard example disconnect sequence + e = sngecomm.CommonDisconnect(n, conn, exampid, tag, ll) if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... + ll.Fatalf("%stag:%s connsess:%s main_disconnect error:%v", + exampid, tag, sngecomm.Lcs, + e.Error()) // Handle this ...... } - ll.Printf("%s v1:%v\n", exampid, "stomp_disconnect_complete_...") - // Close the network connection - e = n.Close() - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "network_close_complete_...") - ll.Printf("%s v1:%v\n", exampid, "ends_...") + ll.Printf("%stag:%s connsess:%s main_elapsed:%v\n", + exampid, tag, conn.Session(), + time.Now().Sub(st)) + } diff --git a/jinterop/artemis/gorecv/gorecv.go b/jinterop/artemis/gorecv/gorecv.go dissimilarity index 61% index 71545b7..5220f83 100644 --- a/jinterop/artemis/gorecv/gorecv.go +++ b/jinterop/artemis/gorecv/gorecv.go @@ -1,114 +1,128 @@ -// -// Copyright © 2011-2016 Guy M. Allard -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/* -A message receiver, to demonstrate JMS interoperability. -*/ -package main - -import ( - "log" - "net" - "os" - // - "github.com/gmallard/stompngo" -) - -var ( - exampid = "gorecv: " - ll = log.New(os.Stdout, "GOJRCVRT ", log.Ldate|log.Lmicroseconds|log.Lshortfile) - nmsgs = 1 -) - -// Connect to a STOMP 1.2 broker, receive some messages and disconnect. -func main() { - ll.Printf("%s v1:%v\n", exampid, "starts_...") - - // Set up the connection. - n, e := net.Dial("tcp", "localhost:31613") - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "dial_complete_...") - ch := stompngo.Headers{"login", "userr", "passcode", "passw0rd", - "host", "localhost", "accept-version", "1.2"} - conn, e := stompngo.Connect(n, ch) - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_connect_complete_...") - - // Setup Headers ... - id := stompngo.Uuid() // Use package convenience function for unique ID - sbh := stompngo.Headers{"destination", "jms.queue.exampleQueue", - "id", id} // subscribe/unsubscribe headers - - // Subscribe - sc, e := conn.Subscribe(sbh) - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_subscribe_complete_...") - - var md stompngo.MessageData - // Read data from the returned channel - for i := 1; i <= nmsgs; i++ { - select { - case md = <-sc: - case md = <-conn.MessageData: - // A RECEIPT or ERROR frame is unexpected here - ll.Fatalf("%s v1:%v\n", exampid, md) // Handle this - } - ll.Printf("%s v1:%v\n", exampid, "channel_read_complete_...") - // MessageData has two components: - // a) a Message struct - // b) an Error value. Check the error value as usual - if md.Error != nil { - ll.Fatalf("%s f4v:%v\n", exampid, md.Error) // Handle this - } - // - ll.Printf("Frame Type: %s\n", md.Message.Command) // Should be MESSAGE - wh := md.Message.Headers - for j := 0; j < len(wh)-1; j += 2 { - ll.Printf("Header: %s:%s\n", wh[j], wh[j+1]) - } - ll.Printf("Payload: %s\n", string(md.Message.Body)) // Data payload - } - // It is polite to unsubscribe, although unnecessary if a disconnect follows. - // With Stomp 1.1+, the same unique ID is required on UNSUBSCRIBE. Failure - // to provide it will result in an error return. - e = conn.Unsubscribe(sbh) // Same headers as Subscribe - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_unsubscribe_complete_...") - - // Disconnect from the Stomp server - dh := stompngo.Headers{} - e = conn.Disconnect(dh) - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "stomp_disconnect_complete_...") - // Close the network connection - e = n.Close() - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "network_close_complete_...") - - ll.Printf("%s v1:%v\n", exampid, "ends_...") -} +// +// Copyright © 2011-2016 Guy M. Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/* +A message receiver, to demonstrate JMS interoperability. +*/ +package main + +import ( + "log" + "os" + "time" + // + "github.com/gmallard/stompngo" + // sngecomm methods are used specifically for these example clients. + "github.com/gmallard/stompngo_examples/sngecomm" +) + +var ( + exampid = "gorecv: " + ll = log.New(os.Stdout, "GOJRCVRT ", log.Ldate|log.Lmicroseconds|log.Lshortfile) + nmsgs = 1 + tag = "jintartgr" +) + +// Connect to a STOMP broker, receive some messages and disconnect. +func main() { + + st := time.Now() + + // Standard example connect sequence + // Use AMQ port here + n, conn, e := sngecomm.CommonConnect(exampid, tag, ll) + if e != nil { + ll.Fatalf("%stag:%s connsess:%s main_on_connect error:%v", + exampid, tag, sngecomm.Lcs, + e.Error()) // Handle this ...... + } + + pbc := sngecomm.Pbc() // Print byte count + + // Setup Headers ... + id := stompngo.Uuid() // Use package convenience function for unique ID + d := "jms.queue.exampleQueue" + sc := sngecomm.HandleSubscribe(conn, d, id, "auto") + ll.Printf("%stag:%s connsess:%s stomp_subscribe_complete\n", + exampid, tag, conn.Session()) + + // + var md stompngo.MessageData + // Read data from the returned channel + for i := 1; i <= nmsgs; i++ { + select { + case md = <-sc: + case md = <-conn.MessageData: + // Frames RECEIPT or ERROR not expected here + ll.Fatalf("%stag:%s connsess:%s bad_frame error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + ll.Printf("%stag:%s connsess:%s channel_read_complete\n", + exampid, tag, conn.Session()) + // MessageData has two components: + // a) a Message struct + // b) an Error value. Check the error value as usual + if md.Error != nil { + ll.Fatalf("%stag:%s connsess:%s error_read error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + ll.Printf("%stag:%s connsess:%s frame_type cmd:%s\n", + exampid, tag, conn.Session(), + md.Message.Command) + + if md.Message.Command != stompngo.MESSAGE { + ll.Fatalf("%stag:%s connsess:%s error_frame_type error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + wh := md.Message.Headers + for j := 0; j < len(wh)-1; j += 2 { + ll.Printf("%stag:%s connsess:%s Header:%s:%s\n", + exampid, tag, conn.Session(), + wh[j], wh[j+1]) + } + if pbc > 0 { + maxlen := pbc + if len(md.Message.Body) < maxlen { + maxlen = len(md.Message.Body) + } + ss := string(md.Message.Body[0:maxlen]) + ll.Printf("%stag:%s connsess:%s payload body:%s\n", + exampid, tag, conn.Session(), + ss) + } + } + + // + sngecomm.HandleUnsubscribe(conn, d, id) + ll.Printf("%stag:%s connsess:%s unsubscribe_complete\n", + exampid, tag, conn.Session()) + + // Standard example disconnect sequence + e = sngecomm.CommonDisconnect(n, conn, exampid, tag, ll) + if e != nil { + ll.Fatalf("%stag:%s connsess:%s main_disconnect error:%v", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... + } + + ll.Printf("%stag:%s connsess:%s main_elapsed:%v\n", + exampid, tag, conn.Session(), + time.Now().Sub(st)) + +} diff --git a/jinterop/artemis/gosend/gosend.go b/jinterop/artemis/gosend/gosend.go index e3d7685..26bcc75 100644 --- a/jinterop/artemis/gosend/gosend.go +++ b/jinterop/artemis/gosend/gosend.go @@ -22,38 +22,35 @@ package main import ( "fmt" "log" - "net" "os" + "time" // "github.com/gmallard/stompngo" "github.com/gmallard/stompngo/senv" + // sngecomm methods are used specifically for these example clients. + "github.com/gmallard/stompngo_examples/sngecomm" ) var ( exampid = "gosend: " ll = log.New(os.Stdout, "GOJSNDRT ", log.Ldate|log.Lmicroseconds|log.Lshortfile) nmsgs = 1 + tag = "jintartgs" ) -// Connect to a STOMP 1.2 broker, send some messages and disconnect. +// Connect to a STOMP broker, send some messages and disconnect. func main() { - ll.Printf("%s v1:%v\n", exampid, "starts_...") - // Open a net connection - n, e := net.Dial("tcp", "localhost:31613") - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "dial_complete_...") + st := time.Now() - // Connect to broker - ch := stompngo.Headers{"login", "userr", "passcode", "passw0rd", - "host", "localhost", "accept-version", "1.2"} - conn, e := stompngo.Connect(n, ch) + // Standard example connect sequence + // Use AMQ port here + n, conn, e := sngecomm.CommonConnect(exampid, tag, ll) if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... + ll.Fatalf("%stag:%s connsess:%s main_on_connect error:%v", + exampid, tag, sngecomm.Lcs, + e.Error()) // Handle this ...... } - ll.Printf("%s v1:%v\n", exampid, "stomp_connect_complete_...") // Suppress content length here, so JMS will treat this as a 'text' message. sh := stompngo.Headers{"destination", "jms.queue.exampleQueue"} @@ -63,30 +60,29 @@ func main() { if senv.Persistent() { sh = sh.Add("persistent", "true") } - ms := exampid + " go message: " + ms := exampid + " message: " for i := 1; i <= nmsgs; i++ { mse := ms + fmt.Sprintf("%d", i) e := conn.Send(sh, mse) - ll.Printf("Go Sender: body:%s\n", mse) if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ... + ll.Fatalf("%stag:%s connsess:%s send_error error:%v\n", + exampid, tag, conn.Session(), + e.Error()) // Handle this ...... } - ll.Printf("%s v1:%v v2:%v\n", exampid, "send complete:", mse) + ll.Printf("%stag:%s connsess:%s send_complete\n", + exampid, tag, conn.Session()) } - // Disconnect from the Stomp server - dh := stompngo.Headers{} - e = conn.Disconnect(dh) + // Standard example disconnect sequence + e = sngecomm.CommonDisconnect(n, conn, exampid, tag, ll) if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... + ll.Fatalf("%stag:%s connsess:%s main_disconnect error:%v", + exampid, tag, sngecomm.Lcs, + e.Error()) // Handle this ...... } - ll.Printf("%s v1:%v\n", exampid, "stomp_disconnect_complete_...") - // Close the network connection - e = n.Close() - if e != nil { - ll.Fatalf("%s %s\n", exampid, e.Error()) // Handle this ...... - } - ll.Printf("%s v1:%v\n", exampid, "network_close_complete_...") - ll.Printf("%s v1:%v\n", exampid, "ends_...") + ll.Printf("%stag:%s connsess:%s main_elapsed:%v\n", + exampid, tag, conn.Session(), + time.Now().Sub(st)) + } diff --git a/version.go b/version.go index a0b26c1..c38dffd 100644 --- a/version.go +++ b/version.go @@ -35,7 +35,7 @@ var ( //patch = "3" // Patch - patch = "3.plvl.010" // Patch + patch = "3.plvl.011" // Patch ) func Version() string { -- 2.11.4.GIT