theLink 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - py - rb - jv - cc
Loading...
Searching...
No Matches
MqContextC_StorageApi_C_API

MqContextC - setup and manage a storage used to persist data-packagesMore...

+ Collaboration diagram for MqContextC_StorageApi_C_API:

Functions

MQ_EXTERN enum MkErrorE MqStorageErrCnt_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_LTR transLId, MK_I32 *cnt_out)
 increment and return the database row-error-count for the row defined with transLId
 
MQ_EXTERN enum MkErrorE MqStorageOpen_RT (MK_RT mkrt, MQ_CTX const ctx, MK_STRN const storageFile)
 switch to a file-based-transaction-database
 
MQ_EXTERN enum MkErrorE MqStorageClose_RT (MK_RT mkrt, MQ_CTX const ctx)
 close the storage. …
 
MQ_EXTERN enum MkErrorE MqStorageExport_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *ltid_out)
 export the read-data-package into the STORAGE
 
MQ_EXTERN enum MkErrorE MqStorageImport_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *transLIdP_inout)
 import the storage-package into the read-data-package
 
MQ_EXTERN enum MkErrorE MqStorageIncrRef_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_LTR transLId)
 increase the internal refCount lock of the database-entry
 
MQ_EXTERN enum MkErrorE MqStorageDecrRef_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_LTR transLId)
 decrease the internal refCount lock of the database-entry
 
MQ_EXTERN enum MkErrorE MqStorageDelete_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *transLIdP_inout)
 delete the storage-row identified by the transLIdP_inout
 
MQ_EXTERN enum MkErrorE MqStorageCount_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *cnt_out)
 count the number of storage-rows
 
MQ_EXTERN enum MkErrorE MqStorageResolve_RT (MK_RT mkrt, MQ_CTX const ctx, MQ_CTX *otherCtxP_out, MQ_LTR *otherLIdP_out)
 extract the context->link.protect.rmtTransLId entry from the database
 

MqStorageLog

MQ_EXTERN enum MkErrorE MqStorageLog_RT (MK_RT mkrt, MQ_CTX const ctx, MK_STRN const callfunc)
 log the storage the status of the open transactions
 

MqContextC - MqContextC_StorageApi_Storage_C_API - overload

#define MqStorageLog_1(ctx)
 
#define MqStorageDelete_NULL(...)
 
#define MqStorageDelete(...)
 
#define MqStorageDelete_1(ctx)
 
#define MqStorageDelete_E(...)
 
#define MqStorageDelete_C(...)
 
#define MqStorageDelete_e(...)
 
#define MqStorageImport_NULL(...)
 
#define MqStorageImport(...)
 
#define MqStorageImport_1(ctx)
 
#define MqStorageImport_E(...)
 
#define MqStorageImport_C(...)
 
#define MqStorageImport_e(...)
 
#define MqStorageClose_NULL(...)
 
#define MqStorageClose(...)
 
#define MqStorageClose_E(...)
 
#define MqStorageClose_C(...)
 
#define MqStorageDecrRef_NULL(...)
 
#define MqStorageDecrRef(...)
 
#define MqStorageDecrRef_E(...)
 
#define MqStorageDecrRef_C(...)
 
#define MqStorageIncrRef_NULL(...)
 
#define MqStorageIncrRef(...)
 
#define MqStorageIncrRef_E(...)
 
#define MqStorageIncrRef_C(...)
 
#define MqStorageLog_NULL(...)
 
#define MqStorageLog(...)
 
#define MqStorageLog_1(ctx)
 
#define MqStorageLog_E(...)
 
#define MqStorageLog_C(...)
 
#define MqStorageOpen_NULL(...)
 
#define MqStorageOpen(...)
 
#define MqStorageOpen_E(...)
 
#define MqStorageOpen_C(...)
 
#define MqStorageCount_NULL(...)
 
#define MqStorageCount(...)
 
#define MqStorageCount_E(...)
 
#define MqStorageCount_C(...)
 
#define MqStorageCount_e(...)
 
#define MqStorageErrCnt_NULL(...)
 
#define MqStorageErrCnt(...)
 
#define MqStorageErrCnt_E(...)
 
#define MqStorageErrCnt_C(...)
 
#define MqStorageErrCnt_e(...)
 
#define MqStorageExport_NULL(...)
 
#define MqStorageExport(...)
 
#define MqStorageExport_E(...)
 
#define MqStorageExport_C(...)
 
#define MqStorageExport_e(...)
 
#define MqStorageResolve_NULL(...)
 
#define MqStorageResolve(...)
 
#define MqStorageResolve_E(...)
 
#define MqStorageResolve_C(...)
 

Detailed Description

MqContextC - setup and manage a storage used to persist data-packages

The storage is divided into: INTERNAL and EXTERNAL storage. Only the read-data-package can be stored or dumped into the storage.

The read-data-package is saved into the storage using:

ServiceStorage setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE
StorageExport export the read-data-package into the STORAGE

The read-data-package is restored from the storage using:

StorageImport import the storage-package into the read-data-package
ProxyForward send the entire read-data-package-data to the link-target
All this usually happen in an Event Handler

Some important facts of the storage-feature:

The following internal storages are supported:

default
The default-storage is set with the configuration parameter --storage fileName and defaults to "#memdb#". If a package have to be saved into the storage and the storage is not open the default-storage id used. The open will always be performed. If an explicit storage is required the default can be changed or a storage can explicit be opened with MqStorageOpen. Keep in mind that the default-storage is a per-context configuration but only one storage per process or thread is currently supported.
memdb
This is the default storage and can be set explicitly with MqStorageOpen using the "#memdb#" parameter.
tmpdb
This storage is like an in-memory-storage but export data to the TEMPORARY filesystem if the application run out of memory. This storage can explicit be set with MqStorageOpen with the parameter "#tmpdb#".
filedb
This storage always work on files. Only this storage is persistent and can explicit be set with MqStorageOpen with the storageFile parameter.

Performance analyse:

database performance host crash application crash info
memdb 30.000 data lost data lost non persistent
tempdb < 30.000 data lost data lost uses memory and/or temporary file
filedb (mem) 10.000 data lost data safe in memory filesystem
filedb (disc) 50 data safe data safe disc-speed is the key factor

Macro Definition Documentation

◆ MqStorageClose

#define MqStorageClose ( ...)
Value:
#define MK_RT_CALL
MQ_EXTERN enum MkErrorE MqStorageClose_RT(MK_RT mkrt, MQ_CTX const ctx)
close the storage. …

Definition at line 808 of file msgque_overload_mq.h.

◆ MqStorageClose_C

#define MqStorageClose_C ( ...)
Value:
if (MkErrorCheckI(MqStorageClose(__VA_ARGS__)))
#define MqStorageClose(...)

Definition at line 810 of file msgque_overload_mq.h.

◆ MqStorageClose_E

#define MqStorageClose_E ( ...)
Value:
MkErrorCheck(MqStorageClose(__VA_ARGS__))

Definition at line 809 of file msgque_overload_mq.h.

◆ MqStorageClose_NULL

#define MqStorageClose_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 807 of file msgque_overload_mq.h.

◆ MqStorageCount

#define MqStorageCount ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageCount_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *cnt_out)
count the number of storage-rows …

Definition at line 831 of file msgque_overload_mq.h.

◆ MqStorageCount_C

#define MqStorageCount_C ( ...)
Value:
if (MkErrorCheckI(MqStorageCount(__VA_ARGS__)))
#define MqStorageCount(...)

Definition at line 833 of file msgque_overload_mq.h.

◆ MqStorageCount_E

#define MqStorageCount_E ( ...)
Value:
MkErrorCheck(MqStorageCount(__VA_ARGS__))

Definition at line 832 of file msgque_overload_mq.h.

◆ MqStorageCount_e

#define MqStorageCount_e ( ...)
Value:
#define MK_EMBEDDED(type, call,...)
int MQ_LTR
32bit longterm transaction token because PHP-32 does NOT support long long

Definition at line 834 of file msgque_overload_mq.h.

◆ MqStorageCount_NULL

#define MqStorageCount_NULL ( ...)
Value:

Definition at line 830 of file msgque_overload_mq.h.

◆ MqStorageDecrRef

#define MqStorageDecrRef ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageDecrRef_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR transLId)
decrease the internal refCount lock of the database-entry

Definition at line 812 of file msgque_overload_mq.h.

◆ MqStorageDecrRef_C

#define MqStorageDecrRef_C ( ...)
Value:
if (MkErrorCheckI(MqStorageDecrRef(__VA_ARGS__)))
#define MqStorageDecrRef(...)

Definition at line 814 of file msgque_overload_mq.h.

◆ MqStorageDecrRef_E

#define MqStorageDecrRef_E ( ...)
Value:
MkErrorCheck(MqStorageDecrRef(__VA_ARGS__))

Definition at line 813 of file msgque_overload_mq.h.

◆ MqStorageDecrRef_NULL

#define MqStorageDecrRef_NULL ( ...)
Value:

Definition at line 811 of file msgque_overload_mq.h.

◆ MqStorageDelete

#define MqStorageDelete ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageDelete_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *transLIdP_inout)
delete the storage-row identified by the transLIdP_inout …

Definition at line 794 of file msgque_overload_mq.h.

◆ MqStorageDelete_1

#define MqStorageDelete_1 ( ctx)
Value:
#define MqStorageDelete(...)

Definition at line 795 of file msgque_overload_mq.h.

◆ MqStorageDelete_C

#define MqStorageDelete_C ( ...)
Value:
if (MkErrorCheckI(MqStorageDelete(__VA_ARGS__)))

Definition at line 797 of file msgque_overload_mq.h.

◆ MqStorageDelete_E

#define MqStorageDelete_E ( ...)
Value:
MkErrorCheck(MqStorageDelete(__VA_ARGS__))

Definition at line 796 of file msgque_overload_mq.h.

◆ MqStorageDelete_e

#define MqStorageDelete_e ( ...)
Value:

Definition at line 798 of file msgque_overload_mq.h.

◆ MqStorageDelete_NULL

#define MqStorageDelete_NULL ( ...)
Value:

Definition at line 793 of file msgque_overload_mq.h.

◆ MqStorageErrCnt

#define MqStorageErrCnt ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageErrCnt_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR transLId, MK_I32 *cnt_out)
increment and return the database row-error-count for the row defined with transLId

Definition at line 836 of file msgque_overload_mq.h.

◆ MqStorageErrCnt_C

#define MqStorageErrCnt_C ( ...)
Value:
if (MkErrorCheckI(MqStorageErrCnt(__VA_ARGS__)))
#define MqStorageErrCnt(...)

Definition at line 838 of file msgque_overload_mq.h.

◆ MqStorageErrCnt_E

#define MqStorageErrCnt_E ( ...)
Value:
MkErrorCheck(MqStorageErrCnt(__VA_ARGS__))

Definition at line 837 of file msgque_overload_mq.h.

◆ MqStorageErrCnt_e

#define MqStorageErrCnt_e ( ...)
Value:
signed int MK_I32

Definition at line 839 of file msgque_overload_mq.h.

◆ MqStorageErrCnt_NULL

#define MqStorageErrCnt_NULL ( ...)
Value:

Definition at line 835 of file msgque_overload_mq.h.

◆ MqStorageExport

#define MqStorageExport ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageExport_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *ltid_out)
export the read-data-package into the STORAGE …

Definition at line 841 of file msgque_overload_mq.h.

◆ MqStorageExport_C

#define MqStorageExport_C ( ...)
Value:
if (MkErrorCheckI(MqStorageExport(__VA_ARGS__)))
#define MqStorageExport(...)

Definition at line 843 of file msgque_overload_mq.h.

◆ MqStorageExport_E

#define MqStorageExport_E ( ...)
Value:
MkErrorCheck(MqStorageExport(__VA_ARGS__))

Definition at line 842 of file msgque_overload_mq.h.

◆ MqStorageExport_e

#define MqStorageExport_e ( ...)
Value:

Definition at line 844 of file msgque_overload_mq.h.

◆ MqStorageExport_NULL

#define MqStorageExport_NULL ( ...)
Value:

Definition at line 840 of file msgque_overload_mq.h.

◆ MqStorageImport

#define MqStorageImport ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageImport_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR *transLIdP_inout)
import the storage-package into the read-data-package …

Definition at line 800 of file msgque_overload_mq.h.

◆ MqStorageImport_1

#define MqStorageImport_1 ( ctx)
Value:
#define MqStorageImport(...)

Definition at line 801 of file msgque_overload_mq.h.

◆ MqStorageImport_C

#define MqStorageImport_C ( ...)
Value:
if (MkErrorCheckI(MqStorageImport(__VA_ARGS__)))

Definition at line 803 of file msgque_overload_mq.h.

◆ MqStorageImport_E

#define MqStorageImport_E ( ...)
Value:
MkErrorCheck(MqStorageImport(__VA_ARGS__))

Definition at line 802 of file msgque_overload_mq.h.

◆ MqStorageImport_e

#define MqStorageImport_e ( ...)
Value:

Definition at line 804 of file msgque_overload_mq.h.

◆ MqStorageImport_NULL

#define MqStorageImport_NULL ( ...)
Value:

Definition at line 799 of file msgque_overload_mq.h.

◆ MqStorageIncrRef

#define MqStorageIncrRef ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageIncrRef_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_LTR transLId)
increase the internal refCount lock of the database-entry

Definition at line 816 of file msgque_overload_mq.h.

◆ MqStorageIncrRef_C

#define MqStorageIncrRef_C ( ...)
Value:
if (MkErrorCheckI(MqStorageIncrRef(__VA_ARGS__)))
#define MqStorageIncrRef(...)

Definition at line 818 of file msgque_overload_mq.h.

◆ MqStorageIncrRef_E

#define MqStorageIncrRef_E ( ...)
Value:
MkErrorCheck(MqStorageIncrRef(__VA_ARGS__))

Definition at line 817 of file msgque_overload_mq.h.

◆ MqStorageIncrRef_NULL

#define MqStorageIncrRef_NULL ( ...)
Value:

Definition at line 815 of file msgque_overload_mq.h.

◆ MqStorageLog

#define MqStorageLog ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageLog_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN const callfunc)
log the storage the status of the open transactions

Definition at line 820 of file msgque_overload_mq.h.

◆ MqStorageLog_1 [1/2]

#define MqStorageLog_1 ( ctx)
Value:
MqStorageLog(ctx,__func__)
#define MqStorageLog(...)

Definition at line 821 of file msgque_overload_mq.h.

◆ MqStorageLog_1 [2/2]

#define MqStorageLog_1 ( ctx)
Value:
MqStorageLog(ctx,__func__)

Definition at line 5010 of file LibMqMsgque_mq.h.

◆ MqStorageLog_C

#define MqStorageLog_C ( ...)
Value:
if (MkErrorCheckI(MqStorageLog(__VA_ARGS__)))

Definition at line 823 of file msgque_overload_mq.h.

◆ MqStorageLog_E

#define MqStorageLog_E ( ...)
Value:
MkErrorCheck(MqStorageLog(__VA_ARGS__))

Definition at line 822 of file msgque_overload_mq.h.

◆ MqStorageLog_NULL

#define MqStorageLog_NULL ( ...)
Value:

Definition at line 819 of file msgque_overload_mq.h.

◆ MqStorageOpen

#define MqStorageOpen ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageOpen_RT(MK_RT mkrt, MQ_CTX const ctx, MK_STRN const storageFile)
switch to a file-based-transaction-database …

Definition at line 825 of file msgque_overload_mq.h.

◆ MqStorageOpen_C

#define MqStorageOpen_C ( ...)
Value:
if (MkErrorCheckI(MqStorageOpen(__VA_ARGS__)))
#define MqStorageOpen(...)

Definition at line 827 of file msgque_overload_mq.h.

◆ MqStorageOpen_E

#define MqStorageOpen_E ( ...)
Value:
MkErrorCheck(MqStorageOpen(__VA_ARGS__))

Definition at line 826 of file msgque_overload_mq.h.

◆ MqStorageOpen_NULL

#define MqStorageOpen_NULL ( ...)
Value:

Definition at line 824 of file msgque_overload_mq.h.

◆ MqStorageResolve

#define MqStorageResolve ( ...)
Value:
MQ_EXTERN enum MkErrorE MqStorageResolve_RT(MK_RT mkrt, MQ_CTX const ctx, MQ_CTX *otherCtxP_out, MQ_LTR *otherLIdP_out)
extract the context->link.protect.rmtTransLId entry from the database

Definition at line 846 of file msgque_overload_mq.h.

◆ MqStorageResolve_C

#define MqStorageResolve_C ( ...)
Value:
if (MkErrorCheckI(MqStorageResolve(__VA_ARGS__)))
#define MqStorageResolve(...)

Definition at line 848 of file msgque_overload_mq.h.

◆ MqStorageResolve_E

#define MqStorageResolve_E ( ...)
Value:
MkErrorCheck(MqStorageResolve(__VA_ARGS__))

Definition at line 847 of file msgque_overload_mq.h.

◆ MqStorageResolve_NULL

#define MqStorageResolve_NULL ( ...)
Value:

Definition at line 845 of file msgque_overload_mq.h.

Function Documentation

◆ MqStorageClose_RT()

MQ_EXTERN enum MkErrorE MqStorageClose_RT ( MK_RT mkrt,
MQ_CTX const ctx )

close the storage. …

the next storage request will open the storage again with the location from Storage

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

◆ MqStorageCount_RT()

MQ_EXTERN enum MkErrorE MqStorageCount_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_LTR * cnt_out )

count the number of storage-rows

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[out]cnt_outnumber of rows, OLL if nothing is available
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

◆ MqStorageDecrRef_RT()

MQ_EXTERN enum MkErrorE MqStorageDecrRef_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_LTR transLId )

decrease the internal refCount lock of the database-entry

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[in]transLIdstorage-id … return from MqStorageImport
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
See also
MqStorageImport, MqStorageIncrRef

◆ MqStorageDelete_RT()

MQ_EXTERN enum MkErrorE MqStorageDelete_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_LTR * transLIdP_inout )

delete the storage-row identified by the transLIdP_inout

The transLIdP_inout is the value returned by a previous MqStorageImport. If transLIdP_inout is None than OLL is used. MqStorageImport and MqStorageDelete work together link an transaction and every successfull transcation have to delete the transLIdP_inout out of the storage. After sucessfull delete the transLIdP_inout is set to 0LL, on error the initial value is unchanged.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[in,out]transLIdP_inoutpointer to storage-id to delete, will be 0LL on success
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

◆ MqStorageErrCnt_RT()

MQ_EXTERN enum MkErrorE MqStorageErrCnt_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_LTR transLId,
MK_I32 * cnt_out )

increment and return the database row-error-count for the row defined with transLId

The storage is typical used in the following workflow:

<----- AT CALLING CLIENT ----->|<----- AT RECEIVING SERVER ----->
                               |
    *setup transaction         |
    make service-request      -->    *start service-handler
                               |     save request into storage
    wait for confirmation     <--    confirm data receiving
                               |     *stop service-handler

  ====================  enter event loop  =====================

                               |     *start event-handler
                               |     load reqest from storage
                               |     process data
    *start transaction        <--    send result-data
    process result-data        |     *stop event-handler
    *stop transaction          |

Example Filter6 - store incoming packages into storage

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[in]transLIdstorage-id … return from MqStorageImport
[out]cnt_outthe new value or -1 on error
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

◆ MqStorageExport_RT()

MQ_EXTERN enum MkErrorE MqStorageExport_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_LTR * ltid_out )

export the read-data-package into the STORAGE

The export include all data required to setup a read-data-package later again. After import with MqStorageImport the read-data-package and the environment will be set as it was on MqStorageExport

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[out]ltid_outif ltid_out != NULL return the storage-id
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
See also
MqDumpExport, MqStorageImport

◆ MqStorageImport_RT()

MQ_EXTERN enum MkErrorE MqStorageImport_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_LTR * transLIdP_inout )

import the storage-package into the read-data-package

Select the read-data-package from the database using the transLIdP. Only a package with refCount = 0 will be selected.
After selection the refCount is incremented and the next call to MqStorageImport using the same transLId will fail.
MqStorageImport is used together with MqStorageDelete or MqStorageDecrRef to delete the selected package from database or to undo the select.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[in,out]transLIdP_inoutstorage-id or None or 0 … return from MqStorageExport
*transLIdP > 0 return the read-data-package identified with the storage-id.
*transLIdP == 0 return the top-most (FIFO) read-data-package and set the transLIdP to the storage-id.
*transLIdP < 0 return an error
transLIdP == NULL like transLIdP == 0
*transLIdP invalid like transLIdP < 0
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
Attention
Read MqProcessEvent for the dependency with the event-loop.
There is no guarantee that a package will be read FIFO.
In principle, the first free package (refCount=0) with the smallest transLId is read.
However, if the package hangs in subsequent processing and the refCount is not reset or the package is not deleted, then the package remains locked and a subsequent call to MqStorageImport will read the next free package.
  • This approach protects a server or router from blocking after an unpredictable failure.
See also
MqDumpExport, MqStorageExport, MqStorageDelete, MqStorageDecrRef, MqStorageIncrRef

◆ MqStorageIncrRef_RT()

MQ_EXTERN enum MkErrorE MqStorageIncrRef_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_LTR transLId )

increase the internal refCount lock of the database-entry

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[in]transLIdstorage-id … return from MqStorageImport
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)
See also
MqStorageImport, MqStorageDecrRef

◆ MqStorageLog_RT()

MQ_EXTERN enum MkErrorE MqStorageLog_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MK_STRN const callfunc )

log the storage the status of the open transactions

◆ MqStorageOpen_RT()

MQ_EXTERN enum MkErrorE MqStorageOpen_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MK_STRN const storageFile )

switch to a file-based-transaction-database

the value can also be set using the --storage commandline option.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[in]storageFilethe file used to create the transaction-database. Allowed values are:
  1. "#memdb#" for a in-memory-database (default)
  2. "#tmpdb#" for a temporary-database-file
  3. filename for a persistent-database-file
Exceptions
MkExceptionC→ The default-exception from the Programming-Language-Micro-Kernel (PLMK)

◆ MqStorageResolve_RT()

MQ_EXTERN enum MkErrorE MqStorageResolve_RT ( MK_RT mkrt,
MQ_CTX const ctx,
MQ_CTX * otherCtxP_out,
MQ_LTR * otherLIdP_out )

extract the context->link.protect.rmtTransLId entry from the database

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on
[out]otherCtxP_outthe ctx of the resolve
[out]otherLIdP_outthe transLId of the resolve