MQServer | PHP写的消息队列服务器,可以用来异步执行一些任务,比如发送邮件,短信之类的
kandi X-RAY | MQServer Summary
kandi X-RAY | MQServer Summary
PHP写的消息队列服务器,可以用来异步执行一些任务,比如发送邮件,短信之类的
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Process a command
- parse command line arguments
- Parse the command line
- Compress the queue
- Opens a stream socket .
- Peeks given length .
- Watch for events .
- Add new queue
- Adds an item to the queue
- Unread a byte .
MQServer Key Features
MQServer Examples and Code Snippets
Community Discussions
Trending Discussions on MQServer
QUESTION
We are using a jms message driven adapter with an error-channel to transfer messages from a MQServer :
...ANSWER
Answered 2021-Mar-16 at 17:38You can add an ExceptionListener
to the DefaultMessageListenerContainer
and handle connection exceptions there.
QUESTION
I want to clarify if I understood the ServiceStack.Server functionality correctly.
On this page, ServiceStack.Server API is described, and it states that
Creates a Redis MQ Server that processes each message on its own background thread
Am I correct when I then assumed that this is a standalone Redis server, so if I start this with the code below, I am running a fully fledged Redis server, meaning, no need to install the Redis software, or Memurai or the likes?
Because, if I follow this example, and have no other running Redis server, I get
'No connection could be made because the target machine actively refused it. 127.0.0.1:6379'
This line
...ANSWER
Answered 2020-May-02 at 09:34Am I correct when I then assumed that this is a standalone Redis server
That's an incorrect conclusion, the Redis Server is a distributed in-memory data structure server which just like other distributed servers like an RDBMS or MQ Broker runs in its own isolated networked process.
All ServiceStack Redis Libraries connect to a Redis Server, Redis MQ is like all other distributed ServiceStack MQ providers which process messages sent to a broker, in this case Redis MQ uses the Redis Server as its broker. The statement:
Creates a Redis MQ Server that processes each message on its own background thread
Explains how Redis MQ processes the messages that it receives, where each different Message Type (i.e. Request DTO Type) processes messages in its own background thread.
QUESTION
I am having trouble starting my JmsListener while the application is running. I tried this answer on the topic, but no luck.
I have autoStartup set to false in my JmsListenerContainerFactory
, and I have messages waiting on the queue. But when I call the controller in the code below, nothing happens. The JmsLister does not start to consume messages.
Any help would be appreciated.
Controller code:
...ANSWER
Answered 2020-Mar-19 at 19:24Strange; this works fine for me...
QUESTION
Issue:
I have a file named: env.sh
which contains some environment variables and i want to initialize this file at the time of login.
I'm using bash
, and after checking on various website, si tried to include this file in my ~/.bash_profile
as well as in ~/.bashrc
:
ANSWER
Answered 2019-Oct-04 at 10:45The stuff after you source env.sh
overrides many of the things it tried to initialize. If you don't want to replace the LD_LIBRARY_PATH
it created etc, move the sourcing of env.sh
to after the stuff in your .bash_profile
.
The code in env.sh
generally does a better job of preserving any earlier customizations. For example, it extends the existing value of LD_LIBRARY_PATH
by adding stuff to the old value, rather than flat out replacing it with a static value.
QUESTION
Based on IBM MQ doc, I need to define a environment variable named MQSERVER
for the MQ server address. So in one process, can I only have one MQ server address, is it correct?
Is there any other way to define MQ server address and have multiple MQ connections to different MQ servers?
...ANSWER
Answered 2019-Jul-04 at 08:41You specify the channel name, host, and port in the MQCD which is referenced from the MQCNO. In C it is the MQCONNX call that allows this. If you specify things in the CCDT then you point to the CCDT with MQCHLLIB=/path/to/table and MQCHLTAB=table_filename.TAB, then you can issue a normal MQCONN (or MQCONNX) call and specify just the queue manager name. It will find this QMNAME in the CCDT and use the connection details provided in the CCDT. – JoshMc 21 mins ago
QUESTION
I have a service stack service with the standard service stack RabbitMQ abstraction. Message queues are automatically created for my type MyRequest, and I have a service method which I have set up to process requests from the MyRequest.In Queue
I was expecting that if I threw an exception within this method that the messages would be placed on the dead letter queue. However they are just being removed from the In queue, and do not go to the dead letter queue
...ANSWER
Answered 2018-Aug-11 at 02:06If you're using an explicit ReplyTo
address any Errors will be sent to that ReplyTo address instead of the DLQ.
If your Response DTO has a ResponseStatus
property the Exception will be populated in the ResponseStatus of the Response DTO, otherwise you can read the Exception Info using the generic ErrorResponse
DTO, e.g:
QUESTION
I am running below command from (commandline only not web client) Webspere MQ client v 8.0.0.9 and i am not able to connect MQ server
...ANSWER
Answered 2018-Jul-04 at 16:13The short answer is to remove the MQSERVER
environment variable. For further details and references read below.
If you specify the MQSERVER
environment variable MQ will only use this information and ignore the the CCDT environment variables (MQCHLLIB
and MQCHLTAB
).
This is referenced in the IBM MQ Knowledge Center page Configuring > Configuring connections between the server and clients > Using IBM MQ environment variables > MQSERVER > Using MQSERVER.
If you use the MQSERVER environment variable to define the channel between your IBM® MQ MQI client machine and a server machine, this is the only channel available to your application, and no reference is made to the client channel definition table (CCDT).
Further information on how MQ application will determine connection details is referenced in the IBM MQ Knowledge Center page Developing applications > Developing MQI applications with IBM MQ > Writing client procedural applications > Running applications in the IBM MQ MQI client environment > Connecting IBM MQ MQI client applications to queue managers
When an application running in an IBM MQ client environment issues an MQCONN or MQCONNX call, the client identifies how it is to make the connection. When an MQCONNX call is issued by an application on an IBM MQ client, the MQI client library searches for the client channel information in the following order:
- Using the contents of the ClientConnOffset or ClientConnPtr fields of the MQCNO structure (if supplied). These fields identify the channel definition structure (MQCD) to be used as the definition of the client connection channel. Connection details can be overridden by using a pre-connect exit. For more information, see Referencing connection definitions using a pre-connect exit from a repository.
- If the MQSERVER environment variable is set, the channel it defines is used.
- If an mqclient.ini file is defined and contains a ServerConnectionParms, the channel that it defines is used. For more information, see Configuring a client using a configuration file and CHANNELS stanza of the client configuration file.
- If the MQCHLLIB and MQCHLTAB environment variables are set, the client channel definition table they point to is used.
- If an mqclient.ini file is defined and contains ChannelDefinitionDirectory and ChannelDefinitionFile attributes, these attributes are used to locate the client channel definition table. For more information, see Configuring a client using a configuration file and CHANNELS stanza of the client configuration file.
Finally, if the environment variables are not set, the client searches for a client channel definition table with a path and name that are established from the DefaultPrefix in the mqs.ini file. If the search for a client definition table fails, the client uses the following paths:
- UNIX and Linux systems: /var/mqm/AMQCLCHL.TAB
- Windows: C:\Program Files\IBM\WebSphere MQ\amqclchl.tab
- IBM i: /QIBM/UserData/mqm/@ipcc
- IBM MQ Appliance: _AMQCLCHL.TAB. They appear under the mqbackup:// URI.
You cannot specify Cipherspec using the MQSERVER
environment variable. This is referenced in the IBM MQ Knowledge Center page Configuring > Configuring connections between the server and clients > Using IBM MQ environment variables > MQSERVER
MQSERVER environment variable is used to define a minimal channel. MQSERVER specifies the location of the IBM® MQ server and the communication method to be used.
You cannot use MQSERVER to define an SSL channel or a channel with channel exits. For details of how to define an SSL channel, see Protecting channels with SSL.
QUESTION
I'm developing a JWT-based multi-tenancy system using ServiceStack. The JWT token contains shard information, and I use JwtAuthProvider
to translate the JWT token to session object following instructions at http://docs.servicestack.net/jwt-authprovider.
Now, I want to use ServiceStack MQ for asynchronous processing. The MQ request needs to be aware of the shard information, so I populate the request context before executing it as follow
...ANSWER
Answered 2018-Jun-16 at 15:25The same Request Context instance can't be resolved from the IOC. The Request Context instance is created in the MQ's RegisterHandler()
where you can add custom data in the IRequest.Items
property, e.g:
QUESTION
I'm using the MQCB
function to add message consumer callback functions for queues that I'm reading from. I'm trying to read from two queues on the same connection, and it seems to work fine when receiving messages: my callback function gets the object handle for the queue that the message was received from.
However, when I get an MQRC_NO_MSG_AVAILABLE
event (since I set MQGMO_WAIT
on my consumer), the object handle is MQHO_NONE
, so I can't tell which queue the event refers to. I could solve that by putting the object handle in the callback context, but is that the way it's supposed to be done? Or am I missing something obvious here?
I'm connecting to a queue manager running version 8.0.0.2 on Linux, using the C client library version 8.0.0.5, likewise on Linux. Here is the output from my sample program, showing object handles being 0:
...ANSWER
Answered 2018-May-09 at 23:26I found information from a few sources on this topic that when put together paint the whole picture (unfortunately IBM's MQ KC does not document this very well to say the least).
At Capitalware's MQ Technical Conference v2.0.1.3 Morag Hughson gave a presentation WebSphere MQ V7 Enhanced Application Programming which has some useful information.
On page six it states:
- Your message consumer can also be called with CallType set to MQCBCT_EVENT_CALL (this is also the only way an Event handler can be called). The message consumer will be given events that are pertinent to the queue it is consuming from, for example, MQRC_GET_INHIBITED whereas the event handler gets connection wide events.
In the IBM MQ v8 KC page MQCBC - Callback context > Fields for MQCBC > Hobj (MQHOBJ) it states:
For an event handler, this value is MQHO_NONE
The IBM provided sample
amqscbf0.c
also demonstrates checking thepContext->CallType
in theMessageConsumer
, if it is typeMQCBCT_EVENT_CALL
it prints the Reason, if it is typeMQCBCT_MSG_REMOVED
it prints the message.
Based on the above information it appears the behavior you see is the expected behavior.
A suggested work around would be to set the CallbackArea
field of each queue's MQCBD
with a unique value that you can use to determine the which queue the event refers to.
On page four of Morag's presentation "WebSphere MQ V7 Enhanced Application Programming" it states the following:
- MQGMO_WAIT with MQGMO.WaitInterval = 0 operates just like MQGMO_NO_WAIT when one uses on an MQGET, but in the case of asynchronous consumers we wish to avoid the consumer from polling in a busy loop in this case, so it operates more like a backstop marker to show when the end of a batch of messages has been reached.
In the table on the same page it under the Asynchronous Consume column for MQGMO_WAIT with MQGMO.WaitInterval = 0
it states:
Only called with MQRC_NO_MSGS_AVAILABLE if just started or has had a message since last 2033
Your consumer will not continuously get events notifying it that no messages are on the queue. An event is only generated if there are no messages when the call back is first started and/or after each time ALL messages have been read (GET) from the queue. Essentially it lets you know that currently no more messages are available after it had read at least one message. This may be useful if you expect batches of messages and want to perform some action after all messages in a batch have been read off the queue.
- Note that MQGMO_NO_WAIT, and MQGMO_WAIT with a WaitInterval of MQWI_UNLIMITED are quite different when passed to MQGET but with the MQCB call their behaviour is the same. The consumer will only be passed messages and events, it will never be passed the reason code indicating no messages. Effectively MQGMO_NO_WAIT will be treated as an indefinite wait. This is to prevent the consumer from endlessly being called with the no messages reason code.
If you really do not need the MQRC_NO_MSG_AVAILABLE
event messages, then MQGMO_NO_WAIT
is probably the way to go.
QUESTION
I managed to send a message from an MQ Client to a MQ Server. In the MQ Client I amqsputc [queue_local] [name_qmgr] and after typing the message it return "Sample AMQSPUT0 end" which means it was sent properly. But when I try to see the message in the MQ Server with amqsbcg [queue_local] [name_qmgr] it throws me an error message:
"Sample AMQSGET0 start MQCONNX ended with reason code 2058", this error appears when the queue manager doesn't exists or when the name is misspelled, but this is not the case.
When i verify the local queue it shows CURDEPTH(1), this means that there is one message on the queue(it was delivered). But i don't know why it doesnt allow me to get the message. In the queue manager error file it only shows something like: "the channel AMQ.... connection ended". I checked the channel I configured for this test:
...ANSWER
Answered 2017-Sep-11 at 16:20The output you provide indicates you are executing amqsget
not amqsbcgc
.
I note that your question mentions amqsbcg
not amqsbcgc
. The c
at the end of the sample name indicates it is the client version of the program.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MQServer
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page