Name | |
---|---|
MAMAExpDLL mama_status | mamaRegexChannelFilter_create(mamaRegexChannelFilter * filter) |
MAMAExpDLL mama_status | mamaRegexChannelFilter_destroy(mamaRegexChannelFilter filter) |
MAMAExpDLL mama_status | mamaRegexChannelFilter_setDefaultChannel(mamaRegexChannelFilter filter, int channel) |
MAMAExpDLL mama_status | mamaRegexChannelFilter_addRegex(mamaRegexChannelFilter filter, const char * regex, int channel) |
MAMAExpDLL mama_status | mamaRegexChannelFilter_getChannel(mamaRegexChannelFilter filter, const char * target, int * channel) |
MAMAExpDLL mama_status mamaRegexChannelFilter_create(
mamaRegexChannelFilter * filter
)
Parameters:
Return: A mama_status value to reflect if this operation was successful.
Creates a MAMA regex filter to help filter strings into channels (ints). The channel itself has no special meaning - it’s simply a number to produce when each regular expression is matched.
The main use case is for load balancing dispatcher queues according to topic names.
MAMAExpDLL mama_status mamaRegexChannelFilter_destroy(
mamaRegexChannelFilter filter
)
Return: A mama_status value to reflect if this operation was successful.
Destroys a MAMA regex filter and all underlying resources
MAMAExpDLL mama_status mamaRegexChannelFilter_setDefaultChannel(
mamaRegexChannelFilter filter,
int channel
)
Parameters:
Return: A mama_status value to reflect if this operation was successful.
Sets a default channel to use if no filters produce hits during matching.
MAMAExpDLL mama_status mamaRegexChannelFilter_addRegex(
mamaRegexChannelFilter filter,
const char * regex,
int channel
)
Parameters:
Return: A mama_status value to reflect if this operation was successful.
Adds a regex string and associated integer. During calls to getChannel, the target string will be matched against this regular expression to see which channel matches it.
MAMAExpDLL mama_status mamaRegexChannelFilter_getChannel(
mamaRegexChannelFilter filter,
const char * target,
int * channel
)
Parameters:
Return: A mama_status value to reflect if this operation was successful.
Looks up all channel filters to see which channel this target should be routed to.
#ifndef MamaRegexChannelFilterH__
#define MamaRegexChannelFilterH__
#if defined(__cplusplus)
extern "C"
{
#endif
#include <mama/config.h>
#include <mama/status.h>
#include <mama/types.h>
MAMAExpDLL
extern mama_status
mamaRegexChannelFilter_create (
mamaRegexChannelFilter* filter
);
MAMAExpDLL
extern mama_status
mamaRegexChannelFilter_destroy (
mamaRegexChannelFilter filter
);
MAMAExpDLL
extern mama_status
mamaRegexChannelFilter_setDefaultChannel (
mamaRegexChannelFilter filter,
int channel
);
MAMAExpDLL
extern mama_status
mamaRegexChannelFilter_addRegex(
mamaRegexChannelFilter filter,
const char* regex,
int channel
);
MAMAExpDLL
extern mama_status
mamaRegexChannelFilter_getChannel (
mamaRegexChannelFilter filter,
const char* target,
int* channel
);
#if defined(__cplusplus)
}
#endif
#endif /* MamaRegexChannelFilterH__ */
Updated on 2023-03-31 at 15:29:16 +0100