Configuration - milak/magicmq GitHub Wiki

MagiqMQ needs only one JSON configuration file :

{
"Version": "0.1", // the version of the configuration file useful for change of version. It is automatic updated
"Groups": [ // list of groups the instance is part
	"all", "group1", "group2"
],
"Topics": [ // list of topics managed
	{
		"Name": "normal-topic",
		"Type": "SIMPLE",
		"Parameters": [
			{
				"Name": "Store", // the way the item are stored
				"Value": "FS" // can be FS : allways stored in file system, RAM : allways stored in memory, or SWAP : stored in memory when item size < MaxRamItemSize, in File System when size > MaxRamItemSize. Nb : only FS is restored
			},
			{
				"Name": "MaxItemSize",
				"Value": "100Mo" // a number and a unit (Ko, Mo, Go), by default, no limitation
			},
			{
				"Name": "MaxItemCount", // the maximum number the topic can hold
				"Value": "100" // a number, by default, no limitation
			},
			{
				"Name": "MaxRamItemSize", // the maximum an item content can be stored in RAM, the property is linked to SWAP store value
				"Value": "10Mo" // a number and a unit (Ko, Mo, Go), by default, 10Mo
			},
			{
				"Name": "Distributed",
				"Value": "NO" // is the topic distributed ? by default NO, possible values : NO, 2, 3, ..., 10%, 50%, ...%, ALL
			},
			{
				"Name": "DistributionStrategy",
				"Value": "AT_LEAST_ONCE" // the distribution strategy, possible values : AT_LEAST_ONCE, AT_MOST_ONCE or EXACTLY_ONCE
			},
			{
				"Name": "TimeToLive",
				"Value": "unlimited" // the time to live for an item in the topic, by default 'unlimited'. The value can be a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". 
			}
		]
	},
	{
		"Name": "urgent-topic",
		"Type": "SIMPLE",
		"Parameters": [
			{
				"Name": "Store", // the way the item are stored
				"Value": "FS" // can be FS : allways stored in file system, RAM : allways stored in memory, or SWAP : stored in memory when item size < MaxRamItemSize, in File System when size > MaxRamItemSize. Nb : only FS is restored
			},
			{
				"Name": "MaxItemSize",
				"Value": "100Mo" // a number and a unit (Ko, Mo, Go), by default, no limitation
			},
			{
				"Name": "MaxRamItemSize",
				"Value": "10Mo" // a number and a unit (Ko, Mo, Go), by default, 10Mo
			},
			{
				"Name": "Distributed",
				"Value": "NO" // is the topic distributed ? by default NO, possible values : NO, 2, 3, ..., 10%, 50%, ...%, ALL
			}
		]
	},
	{
		"Name": "topic",
		"Type": "VIRTUAL",
		"Topics": [
			"urgent-topic",
			"normal-topic"
		],
		"Parameters": [
			{
				"Name": "Strategy", // the strategy to browse the topics
				"Value": "ORDERED" // can be : ORDERED, ROUND-ROBIN
			} // no other parameter supported
		]			
	},
	{
		"Name": "distributed-topic",
		"Type": "SIMPLE",
		"Parameters": [
			{
				"Name": "Store", // the way the item are stored
				"Value": "FS" // can be FS : allways stored in file system, RAM : allways stored in memory, or SWAP : stored in memory when item size < MaxRamItemSize, in File System when size > MaxRamItemSize. Nb : only FS is restored
			},
			{
				"Name": "MaxItemSize",
				"Value": "100Mo" // a number and a unit (Ko, Mo, Go), by default, no limitation
			},
			{
				"Name": "MaxRamItemSize",
				"Value": "10Mo" // a number and a unit (Ko, Mo, Go), by default, 10Mo
			},
			{
				"Name": "Distributed",
				"Value": "YES" // is the topic distributed ? by default NO, possible values : NO, 2, 3, ..., 10%, 50%, ...%, ALL
			},
			{
				"Name": "DistributedGroups",
				"Value": "all" // indicates which groups the topic will be distributed. By default "all" is used. When more than one group must be specified, use a coma separated list
			}
		]
	}
],
"Services": [
	{
		"Name": "ADMIN",
		"Comment": "This service opens web administration. It requires REST service. Parameter : 'root' directory containing admin web files. Can be replaced by apache httpd.",
		"Active": true,
		"Parameters": [
			{
				"Name": "root",
				"Value": "web"
			}
		]
	},
	{
		"Name": "REST",
		"Comment": "This service opens REST API. Parameter : 'port' the listening port.",
		"Active": true,
		"Parameters": [
			{
				"Name": "port",
				"Value": "8080"
			}
		]
	},
	{
		"Name": "SYNC",
		"Comment": "This service opens Synchronization port for clusterisation. Parameter : 'port' the listening port.",
		"Active": true,
		"Parameters": [
			{
				"Name": "port",
				"Value": "1789"
			}
		]
	}
]
}