RapidSMS 0.13.0 release notes¶
Welcome to RapidSMS 0.13.0! These release notes cover the new features 0.13.0 as well as some Backwards-incompatible changes in RapidSMS 0.13.0 you’ll want to be aware of when upgrading from RapidSMS 0.12.0.
What’s New¶
- Added support for sending bulk messages. This involved the following changes:
- Modified
MessageBase
to accept multiple connections. - Updated
rapidsms.router.send()
to pass multiple connections (within a message object) to the Router. The Messaging API already supported multiple connections, so the API did not change. - Updated
rapidsms.backends.base.BackendBase.send()
signature to always expect multiple connections and changed the signature to accepttext
andidentities
, rather than a message object. Child classes must now override this function. - Updated
BlockingRouter
to inspect outbound message connections, group by backend, and callbackend.send
for each one.
- Modified
Added the database-powered
DatabaseRouter
. TheDatabaseRouter
stores all messages in the database and keeps track of received/sent state of each message. This is useful for monitoring the sending of large message volumes.Added a backend for Vumi.
Cleaned up admin for
Connection
to load faster with database JOINs.Added delivery report functionality for Kannel.
Combined the
BaseRouter
andBlockingRouter
together. Now all base routing functionality is handled byBlockingRouter
.In order to better support customization of routers, messages now pass through
receive_incoming
andprocess_incoming
methods. This additional layer allows theCeleryRouter
andDatabaseRouter
to more easily customize message processing.The Messaging API now asks the router to instantiate incoming and outgoing messages via the
new_incoming_message
andnew_outgoing_message
methods. This allows the router to better customize the message classes.Reworked the
CeleryRouter
to pass identifiers, rather than instantiated objects, to background tasks. This avoids tasks possibly using outdated data when unpickling task arguments.Removed
rapidsms.tests.harness.setting
.Added requests as a dependency. Vumi and Kannel now use requests to construct HTTP requests. You’ll need to run
pip install requests
or addrequests
to your requirements file.Added initial migrations for South support. South handles making incremental changes to database tables as Django models change. To start using:
- Convert your apps to South
- Upgrade to RapidSMS 0.13.0
- Bring database up to the current model definitions:
python manage.py syncdb --all
- Tell South that everything is up to date:
python manage.py migrate --fake
Once South is set up, future upgrades of RapidSMS should just require
manage.py migrate
to update your database tables.Deprecated
rapidsms.log.mixin.LoggerMixin
. Please update all logging to use the standard logging module. That includes code that might use LoggerMixin indirectly by extendingAppBase
,BackendBase
, orBaseHandler
. Search for code likeself.error(...)
orself.debug(...)
and change tologger.error(...)
orlogger.debug(...)
after creating a logger object as above. You’ll want most logging to look like this:
import logging
logger = logging.getLogger(__name__)
logger.info(...)
logger.debug(...)
- The HTTPTester contrib app has been changed
to use the new Database backend instead of its own backend. The HTTPTester
backend has been removed. Please remove
"rapidsms.contrib.httptester.backend"
fromINSTALLED_BACKENDS
and review the HTTPTester configuration. - Added
created_on
andmodified_on
fields to theContact
andConnection
models. On initial migration, any existing records will have those fields set to the current time.
Backwards-incompatible changes in RapidSMS 0.13.0¶
In the goal of improving the RapidSMS core, we have made a number of backwards- incompatible changes.
Backend configuration must point to a class¶
In previous versions of RapidSMS, you would define backends like so:
INSTALLED_BACKENDS = {
"kannel-fake-smsc" : {
"ENGINE": "rapidsms.backends.kannel",
}
}
Now, backends must specify the name of the class:
INSTALLED_BACKENDS = {
"kannel-fake-smsc" : {
"ENGINE": "rapidsms.backends.kannel.KannelBackend",
}
}
This change was made to be more explicit. This also simplifies the importing architecture.
Changed Backend.send
signature¶
All exisitng backends must be updated to use the new signature. The router used
to pass just a message object to BackendBase.send
. The signature has been updated to
accept an id_
, text
, list of identities
, and a context
dictionary. All backends will need to be updated to use this signature. Please
see BackendBase.send
for more
details.
Removed start/stop methods¶
We removed the left over start
and stop
methods for the router,
backends, and apps. These were important for the legacy, threaded router, but
are no longer necessary with new-routing. If your apps and backends use these
methods, you’ll need to move the functionality to __init__
.
Removed Message translation functionality¶
Now that Message objects can contain multiple connections, the internal translation bits needed to change. Messages can be sent to connections that specify different default languages. We removed all translation functionality from the Message objects and require the developer to handle it explicitly.
The internationalization documentation has been updated.
Changed HTTPTester to use Database backend¶
The HTTPTester contrib app has been changed
to use the new Database backend instead of its own backend. The HTTPTester
backend has been removed. Please remove "rapidsms.contrib.httptester.backend"
from INSTALLED_BACKENDS
and review the HTTPTester configuration.