Update edkb04 ohne Debug.log
This commit is contained in:
@@ -184,14 +184,14 @@ Public Class EDKB04OP
|
|||||||
#Region "Timer"
|
#Region "Timer"
|
||||||
Public Sub OnTimedEvent(ByVal source As Object, ByVal e As ElapsedEventArgs) Handles tmrQueuePolling.Elapsed
|
Public Sub OnTimedEvent(ByVal source As Object, ByVal e As ElapsedEventArgs) Handles tmrQueuePolling.Elapsed
|
||||||
Try
|
Try
|
||||||
m_log.log("EDKB04: OnTimedEvent called", Common.Common.JournalEntryType.Information)
|
'm_log.log("EDKB04: OnTimedEvent called", Common.Common.JournalEntryType.Information)
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Start")
|
|
||||||
ReadfromMQ()
|
ReadfromMQ()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Error: " + ex.Message)
|
|
||||||
m_log.log("EDKB04: Exception catched in OnTimedEvent()")
|
m_log.log("EDKB04: Exception catched in OnTimedEvent()")
|
||||||
Finally
|
Finally
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Finally")
|
|
||||||
tmrQueuePolling.Start()
|
tmrQueuePolling.Start()
|
||||||
m_log.log("EDKB04: tmrQueuePolling.Started")
|
m_log.log("EDKB04: tmrQueuePolling.Started")
|
||||||
End Try
|
End Try
|
||||||
@@ -382,9 +382,7 @@ Public Class EDKB04OP
|
|||||||
|
|
||||||
|
|
||||||
Private Function ReadfromMQ() As Boolean
|
Private Function ReadfromMQ() As Boolean
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Globals")
|
|
||||||
Globals.archiveFilename = ""
|
Globals.archiveFilename = ""
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Dim")
|
|
||||||
Dim mqQMgr As MQQueueManager '* MQQueueManager instance
|
Dim mqQMgr As MQQueueManager '* MQQueueManager instance
|
||||||
Dim mqQueue As MQQueue = Nothing '* MQQueue instance
|
Dim mqQueue As MQQueue = Nothing '* MQQueue instance
|
||||||
Dim queueName As String '* Name of queue to use
|
Dim queueName As String '* Name of queue to use
|
||||||
@@ -393,34 +391,25 @@ Public Class EDKB04OP
|
|||||||
|
|
||||||
'tmrQueuePolling.Stop()
|
'tmrQueuePolling.Stop()
|
||||||
'm_log.Log("EDKB04: Start MQ Verbindungsaufbau", Common.Common.JournalEntryType.Information)
|
'm_log.Log("EDKB04: Start MQ Verbindungsaufbau", Common.Common.JournalEntryType.Information)
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: QueueName:" + Params.MQQueueName)
|
|
||||||
queueName = Params.MQQueueName
|
queueName = Params.MQQueueName
|
||||||
Try
|
Try
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: MQEnv: Hostname" + Params.MQHostname)
|
|
||||||
MQEnvironment.Hostname = Params.MQHostname 'Bsp: "vb0049d"
|
MQEnvironment.Hostname = Params.MQHostname 'Bsp: "vb0049d"
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: MQEnv: Port" + Params.MQPort)
|
|
||||||
MQEnvironment.Port = Params.MQPort 'Bsp: 1416
|
MQEnvironment.Port = Params.MQPort 'Bsp: 1416
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: MQEnv: Channel" + Params.MQChannel)
|
|
||||||
MQEnvironment.Channel = Params.MQChannel 'Bsp: "TGKB.D16.EDOKA.CL"
|
MQEnvironment.Channel = Params.MQChannel 'Bsp: "TGKB.D16.EDOKA.CL"
|
||||||
Try
|
Try
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: New MQQueueManager")
|
|
||||||
mqQMgr = New MQQueueManager()
|
mqQMgr = New MQQueueManager()
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: AccessQueue")
|
|
||||||
mqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING) '* open queue for input but not if MQM stopping
|
mqQueue = mqQMgr.AccessQueue(queueName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING) '* open queue for input but not if MQM stopping
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Error: " + ex.Message)
|
|
||||||
m_log.log("EDKB04: MQ Error: " & ex.Message, Common.Common.JournalEntryType.Error)
|
m_log.log("EDKB04: MQ Error: " & ex.Message, Common.Common.JournalEntryType.Error)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Catch mqe As IBM.WMQ.MQException
|
Catch mqe As IBM.WMQ.MQException
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: MQExeption: " + mqe.Message)
|
|
||||||
m_log.log("EDKB04: Error: " & mqe.Message, Common.Common.JournalEntryType.Error)
|
m_log.log("EDKB04: Error: " & mqe.Message, Common.Common.JournalEntryType.Error)
|
||||||
m_log.log("EDKB04: Errorcode: " & mqe.CompletionCode, Common.Common.JournalEntryType.Error)
|
m_log.log("EDKB04: Errorcode: " & mqe.CompletionCode, Common.Common.JournalEntryType.Error)
|
||||||
m_log.Log("EDKB04: Reasoncode: " & mqe.ReasonCode, Common.Common.JournalEntryType.Error)
|
m_log.Log("EDKB04: Reasoncode: " & mqe.ReasonCode, Common.Common.JournalEntryType.Error)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Try
|
Try
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Verarbeitung")
|
|
||||||
Dim isContinue As Boolean = True
|
Dim isContinue As Boolean = True
|
||||||
Dim strXMLContent As String
|
Dim strXMLContent As String
|
||||||
Do While (isContinue = True)
|
Do While (isContinue = True)
|
||||||
@@ -442,7 +431,6 @@ Public Class EDKB04OP
|
|||||||
mqGetMsgOpts.Options = MQC.MQGMO_WAIT
|
mqGetMsgOpts.Options = MQC.MQGMO_WAIT
|
||||||
|
|
||||||
Try
|
Try
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: GetQueue:")
|
|
||||||
mqQueue.Get(mqMsg, mqGetMsgOpts)
|
mqQueue.Get(mqMsg, mqGetMsgOpts)
|
||||||
'mqQueue.
|
'mqQueue.
|
||||||
If (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) = 0) Then
|
If (mqMsg.Format.CompareTo(MQC.MQFMT_STRING) = 0) Then
|
||||||
@@ -456,7 +444,6 @@ Public Class EDKB04OP
|
|||||||
result = False
|
result = False
|
||||||
End If
|
End If
|
||||||
Catch mqe As IBM.WMQ.MQException
|
Catch mqe As IBM.WMQ.MQException
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Error GetQueue: " + mqe.Message)
|
|
||||||
'* report reason, if any
|
'* report reason, if any
|
||||||
|
|
||||||
If (mqe.Reason = MQC.MQRC_NO_MSG_AVAILABLE) Then
|
If (mqe.Reason = MQC.MQRC_NO_MSG_AVAILABLE) Then
|
||||||
@@ -464,7 +451,6 @@ Public Class EDKB04OP
|
|||||||
m_log.log("EDKB04: no more messages", Common.Common.JournalEntryType.Information)
|
m_log.log("EDKB04: no more messages", Common.Common.JournalEntryType.Information)
|
||||||
isContinue = False
|
isContinue = False
|
||||||
Else
|
Else
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Error: myStopper")
|
|
||||||
|
|
||||||
'* general report for other reasons
|
'* general report for other reasons
|
||||||
If Me.myStopper.insert Then m_log.log("EDKB04: MQQueue::Get ended with {0}: " & mqe.Message, Common.Common.JournalEntryType.Error)
|
If Me.myStopper.insert Then m_log.log("EDKB04: MQQueue::Get ended with {0}: " & mqe.Message, Common.Common.JournalEntryType.Error)
|
||||||
@@ -472,6 +458,7 @@ Public Class EDKB04OP
|
|||||||
'* treat truncated message as a failure for this sample
|
'* treat truncated message as a failure for this sample
|
||||||
'If (mqe.Reason = MQC.MQRC_TRUNCATED_MSG_FAILED) Then
|
'If (mqe.Reason = MQC.MQRC_TRUNCATED_MSG_FAILED) Then
|
||||||
isContinue = False
|
isContinue = False
|
||||||
|
|
||||||
'End If
|
'End If
|
||||||
End If
|
End If
|
||||||
result = False
|
result = False
|
||||||
@@ -481,7 +468,6 @@ Public Class EDKB04OP
|
|||||||
End If
|
End If
|
||||||
Loop
|
Loop
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
File.AppendAllText(appPath + "\debug.log", Environment.NewLine + "ReadFromMQ: Error bei GET: " + ex.Message)
|
|
||||||
If Me.myStopper.insert Then m_log.log("EDKB04: Error bei GET: " & ex.Message, Common.Common.JournalEntryType.Error)
|
If Me.myStopper.insert Then m_log.log("EDKB04: Error bei GET: " & ex.Message, Common.Common.JournalEntryType.Error)
|
||||||
result = False
|
result = False
|
||||||
Finally
|
Finally
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user