#include <apr-1/apr_general.h>
#include <apr-1/apr_network_io.h>
#include <apr-1/apr_hash.h>
#include <apr-1/apr_uri.h>
#include "stomp_status.h"
#include "stomp_connection.h"
#include "stomp_engine.h"
#include "stomp_frame.h"
#include "stomp_io.h"
#include "stomp_headers.h"
#include "stomp_ex_properties.h"
#include "stomp_message.h"
Go to the source code of this file.
|
stomp_messenger_t * | stomp_messenger_init () |
|
void | stomp_messenger_destroy (stomp_messenger_t **messenger) |
|
void | stomp_messenger_set_timeout (stomp_messenger_t *messenger, int32_t timeout) |
|
stomp_status_code_t | stomp_set_endpoint (stomp_messenger_t *messenger, const char *uri) |
|
stomp_status_code_t | stomp_connect (stomp_messenger_t *messenger, stomp_connection_header_t *header, int32_t timeout) |
|
stomp_status_code_t | stomp_disconnect (stomp_messenger_t *messenger, stomp_disconnection_header_t *header) |
|
stomp_status_code_t | stomp_subscribe (stomp_messenger_t *messenger, stomp_subscription_header_t *header) |
|
stomp_status_code_t | stomp_unsubscribe (stomp_messenger_t *messenger, stomp_subscription_header_t *header) |
|
stomp_status_code_t | stomp_ack (stomp_messenger_t *messenger, stomp_ack_header_t *header) |
|
stomp_status_code_t | stomp_nack (stomp_messenger_t *messenger, stomp_ack_header_t *header) |
|
stomp_status_code_t | stomp_begin (stomp_messenger_t *messenger, stomp_transaction_header_t *header) |
|
stomp_status_code_t | stomp_commit (stomp_messenger_t *messenger, stomp_transaction_header_t *header) |
|
stomp_status_code_t | stomp_abort (stomp_messenger_t *messenger, stomp_transaction_header_t *header) |
|
stomp_status_code_t | stomp_send (stomp_messenger_t *messenger, stomp_send_header_t *header, stomp_message_t *message) |
|
stomp_status_code_t | stomp_receive (stomp_messenger_t *messenger, stomp_receive_header_t *header, stomp_message_t *message) |
|
This struct provides an abstraction for some of the message exchange details
Copyright 2016 Otavio Rodolfo Piske
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Aborts a transaction
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Acknowledges the processing of a message
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Begin a transaction
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Commits a transaction
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Connects to the endpoint associated with the messenger
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
timeout | the timeout in milliseconds |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Disconnects from the endpoint associated with the messenger
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Destroys the messenger object. The object will be unusable after destruction
- Parameters
-
messenger | An instance of the messenger object |
Initializes the messenger object
- Returns
- A messenger object that can be used to exchange data via STOMP
Copyright 2016 Otavio Rodolfo Piske
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Sets the timeout for messenger communication. The value set also applies to receipt messages
- Returns
- A messenger object that can be used to exchange data via STOMP
- Parameters
-
timeout | the timeout in milliseconds |
Not-acknowledges the processing of a message
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Reads the exchange data from the broker. The returned exchange may be a message or an error.
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
message | the message to exchange |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Sends a message
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
message | the message to exchange |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Sets the communication endpoint for the message exchange.
- Parameters
-
messenger | An instance of the messenger object |
uri | A connection uri in the stomp://[user]:[password]<hostname>:<port>/<endpoint address>=""> |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Subscribes to the endpoint associated with the messenger
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object
Unsubscribes from the endpoint associated with the messenger
- Parameters
-
messenger | A pointer to an instance of the messenger object |
header | A pointer to an instance of the appropriate header object for the given exchange. The instance of the object must contain the required frame headers as expected by the frame. |
- Returns
- STOMP_SUCCESS if successful or STOMP_FAILURE is failed. Upon failure, the code will set the error details on the status member of the messenger object