"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "monasca_api/api/core/log/log_publisher.py" between
monasca-api-3.1.0.tar.gz and monasca-api-4.0.0.tar.gz

About: OpenStack Monasca API is a RESTful API server that is designed with a layered architecture and supports Monitoring as a Service (MONaaS).
The "Ussuri" series (latest release).

log_publisher.py  (monasca-api-3.1.0):log_publisher.py  (monasca-api-4.0.0)
skipping to change at line 19 skipping to change at line 19
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import time import time
import falcon import falcon
from monasca_common.kafka import producer from monasca_api.common.rest import utils as rest_utils
from monasca_common.rest import utils as rest_utils from monasca_common.kafka import client_factory
from oslo_log import log from oslo_log import log
from oslo_utils import encodeutils from oslo_utils import encodeutils
from monasca_api.api.core.log import model from monasca_api.api.core.log import model
from monasca_api import conf from monasca_api import conf
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
CONF = conf.CONF CONF = conf.CONF
_RETRY_AFTER = 60 _RETRY_AFTER = 60
skipping to change at line 64 skipping to change at line 64
see `monasca_common`_ github repository. see `monasca_common`_ github repository.
.. _monasca_common: https://github.com/openstack/monasca-common .. _monasca_common: https://github.com/openstack/monasca-common
""" """
def __init__(self): def __init__(self):
self._topics = CONF.kafka.logs_topics self._topics = CONF.kafka.logs_topics
self.max_message_size = CONF.log_publisher.max_message_size self.max_message_size = CONF.log_publisher.max_message_size
self._kafka_publisher = producer.KafkaProducer( self._kafka_publisher = client_factory.get_kafka_producer(
url=CONF.kafka.uri CONF.kafka.uri, CONF.kafka.legacy_kafka_client_enabled)
)
LOG.info('Initializing LogPublisher <%s>', self) LOG.info('Initializing LogPublisher <%s>', self)
def send_message(self, messages): def send_message(self, messages):
"""Sends message to each configured topic. """Sends message to each configured topic.
Note: Note:
Falsy messages (i.e. empty) are not shipped to kafka Falsy messages (i.e. empty) are not shipped to kafka
See also See also
 End of changes. 2 change blocks. 
5 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)